I've been searching this everywhere, I'm probably just being thick but is there a way to read a csv file from a particular row onwards? I have a csv file but want to read the data from the 14th row onwards. Below is my csv reader.
CSVReader reader=new CSVReader(new FileReader(filename1));
String [] value ;
while((value=reader.readNext())!=null){
The data inside the csv is something like this
1 djennings93
2 27/02/2014
3 13:31
...
14 26/02/14 14:25:00, www.google.co.uk, 50, Google
I'd like to ignore the data from lines 1-13
You can skip the first 13 lines by doing:
CSVReader reader = new CSVReader(new FileReader("yourfile.csv"), '\t', '\'', 13);
Have a look here. (question Can I use my own separators and quote characters?)
This will result in reading the data from the 14th line onward.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With