java - How to ignore parsing rest of the csv file after a particular condition? -


i parsing csv file , file

07-jan-2016 better lead behind , put others in front, when celebrate victory when nice things occur. take front line when there danger. people appreciate leadership.  main thing have remember on journey is, nice , smile.  other third quote   , content here goes on  --------- ---------- ----------- 

my question how can ignore parsing file after particular line "some other third quote "

i reading csv file shown below

 string csvfile = "ip/asrer070116.csv";   bufferedreader br = null;   string line = "";   try {    br = new bufferedreader(new filereader(csvfile));    while ((line = br.readline()) != null) {     system.out.println(line);    }   }  

could please tell me how resolve ??

you can check every line substring , break out of loop when particular condition met

//inside  loop     if (line.contains("some_string"))   break; 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -