I was trying a CSV using "," as the split delimiter but when I checked the file, I found that the CSV contains , in the field example
"id26305","This process, however, afforded me no means of ascertaining the dimensions of my dungeon; as I might make its circuit, and return to the point whence I set out, without being aware of the fact; so perfectly uniform seemed the wall.","EAP"
I am using Java and here's my code to read the file. Any Suggestions?
private static ArrayList<Record> readRecordFromCSVFile(String filename){
File f=new File(filename);
ArrayList<Record>r=new ArrayList<>();
try {
BufferedReader br = new BufferedReader(new FileReader(filename));
String line=br.readLine();
String line2="";
while ((line2 = br.readLine()) != null) {
String[]attributes=line2.split(";?(?:(?:\"((?:[^\"]|\"\")*)\")|([^;]*))");
Record record=createRecord(attributes);
r.add(record);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return r;
}