HI , Sorry I didn't wrote the complete code earlier :
File file = new File("test_file"); FileReader fr = new FileReader(file); BufferedReader br = new BufferedReader(fr); while( (line=br.readLine()) != null ) { line = line.trim(); System.out.println( line ); if (line.charAt(0)=='#') { continue; } } ( When a line starts with a # I want to ignore that ) In above senario , file is read upto empty line and next lines were not read what is the problem with above code ?
I remember using ready() method when i wrote code long time back.. So try to put an AND condition in your while loop using ready() method..There may be some better ways as well...
Hi could your problem be within the while loop - i.e. you are looping until it finds a null line (which a blank line could be), would it not be better to use an end of file marker - This is only a suggestion of course.