I'm trying to parse a csv file (probably made in excel, or access).
Each field is separated by a "," (comma) but some fields are empty, so I'm not getting the data correctly.
Below is what I'm doing now. Is there a better way to parse?
This line works fine:
23, something, aTitle, something, Smith
This line gives me wrong values:
Both come from the same table with 4 fields.
String line = in.readLine();
StringTokenizer st = new StringTokenizer(line,",");
String nextFieldData = st.nextToken();
String ID = (nextFieldData);
String Title = (nextFieldData);
String Name = (nextFieldData);