Does it work if you escape the quoted commas with \ ?
Name, Age, Sex
"Cantor\, Georg", 163,M
Most delimited formats require that their delimiter be escaped in order to properly parse.
A rough Java example:
import java.util.Iterator;
public class CsvTest {
public static void main(String[] args) {
String[] lines = { "Name, Age, Sex", "\"Cantor, Georg\", 163, M" };
StringBuilder result = new StringBuilder();
for (String head : iterator(lines[0])) {
result.append(String.format("<tr>%s</tr>\n", head));
}
for (int i=1; i < lines.length; i++) {
for (String row : iterator(lines[i])) {
result.append(String.format("<td>%s</td>\n", row));
}
}
System.out.println(String.format("<table>\n%s</table>", result.toString()));
}
public static Iterable<String> iterator(final String line) {
return new Iterable<String>() {
public Iterator<String> iterator() {
return new Iterator<String>() {
private int position = 0;
public boolean hasNext() {
return position < line.length();
}
public String next() {
boolean inquote = false;
StringBuilder buffer = new StringBuilder();
for (; position < line.length(); position++) {
char c = line.charAt(position);
if (c == '"') {
inquote = !inquote;
}
if (c == ',' && !inquote) {
position++;
break;
} else {
buffer.append(c);
}
}
return buffer.toString().trim();
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
};
}
}