I have the following code to read from csv file in android. It works fine expect for the case when i have commas in my column values.
File file = new File(IMPORT_ITEM_FILE.getPath());
BufferedReader bufRdr = null;
try {
bufRdr = new BufferedReader(new FileReader(file));
} catch (FileNotFoundException e) {
}
String line = null;
try {
while ((line = bufRdr.readLine()) != null) {
String[] insertValues = line.split(",");
string column1 = insertValues[1];
string column2 = insertValues[2];
}
bufRdr.close();
}
My csv row is like : name of user ,"some string, with commas","2740740, 2740608",,"some, string, with commas"
How can i escape the commas within column values to read the columns.