Here is my code
BufferedReader br = new BufferedReader(new InputStreamReader(sr));
String splitBy = ",";
String line = br.readLine();
while((line = br.readLine()) != null){
String[] b = line.split(splitBy);
System.out.println("\"" + b[0] + "\",\"" +b[4] + "\",\""+ b[6] + "\"");
}
br.close();
}
}
The columns in my csv file should print out like this
"John", "Smith", "Smith,John"
but it takes the comma in the column and splits it into two columns like this;
""Smith" John"", "John", "Smith"
How can I get it to ignore the column that is in the column and not split it into two columns AND stop it from adding double quotes.
Thanks in advance