I am using opencsv to read a csv file. Some time the csv files have single or double quotes in them. How do i read them without changing the data in the csv file itself.
Right now if I replace a single quote with two single quotes it works fine, same with double quotes, replace a single one with two and it works. But I do not want to touch the source file.
The code to access is as following
CSVReader reader = new CSVReader(new InputStreamReader(new FileInputStream(file), "UTF-8"), delimiter,'\"',0);
data = a1;b1;c1;hello"world;d1;e1
a2;b3;c2;hello"world;d2;e2
; is the delimiter
The result of this is the next row which also contains a double quote is skipped, All odd numbered rows are inserted where as the even numbered rows are skipped
Thanks in advance