I am trying to read a file using FileReader. save it in BufferedReader and print it in a new file using PrintWriter. But the condition is that i need to print only 8 lines from a file of 200 lines.
How to print nextLine from BufferedReder ???
posted 7 years ago
in reading loop what you were doing is reading the file until the buffereReader.nextLine() exists rather than doing this you should just loop for about 8 iteration and then in these loop read from bufferedReader.