Am having trouble reading a csv file with commas within its fields. it produces double quote when the csv is read and when this data is passed into a table the quotes rearranges the position of the values in different columns. I used the "|" to represent tables as a view but it is seperated with commas.
when it is open in with excel
LD |LA| L| T |A
Car Park Store,| |4a|South Bank Road |
when it is opened with the codes
LD |LA| L| T |A
"Car Park Store |" | | 4a |South Bank Road
the idea is to make it appear the way it does in the excel.
public void readFromFile(){
List<String> output = new ArrayList<String>();
try{
BufferedReader bufferedReader = new BufferedReader(new FileReader(filename));
String line = "";
while ((line = bufferedReader.readLine()) != null){
output.add(line);
}
bufferedReader.close();
} catch(FileNotFoundException fne){
csvReaderErrorMessage += "File '" + filename + "' cannot be found.";
}catch(IOException ioe){
csvReaderErrorMessage += "Problem reading file: '" + filename+"'";
}
csvDataModel.setData(output);
}