I am trying to read big CSV
and TSV
(tab-separated) Files with about 1000000
rows or more. Now I tried to read a TSV
cont
Try switching libraries as suggested by Satish
. If that doesn't help, you have to split the whole file into tokens and process them.
Thinking that your CSV
didn't had any escape characters for commas
// r is the BufferedReader pointed at your file
String line;
StringBuilder file = new StringBuilder();
// load each line and append it to file.
while ((line=r.readLine())!=null){
file.append(line);
}
// Make them to an array
String[] tokens = file.toString().split(",");
Then you can process it. Don't forget to trim the token before using it.