First page Back Continue Last page Overview Graphics
Reading a text file line by line (The good way)
//reads an input text file and creates a new file which does not contain any empty lines in it.
public static void removeEmptyLines( String fileName, String destFileName) throws IOException{
- BufferedReader bufIn = new BufferedReader(
- new FileReader(fileName));
- BufferedWriter bufOut = new BufferedWriter(
- new FileWriter(destFileName));
- //continued on next slide...