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
Post a Comment