I imported a CSV file that uses commas as its delimiter, but some fields also contain commas. When I import the file into Mathematica as follows
file = Import["file.csv", "Table", FieldSeparators -> ","]
It works and outputs stuff like this
{{"Epitope ID", "Sequence", "Mapped Start Position",
"Mapped End Position", "Identity", "Subjects Tested",
"Subjects Responded", "Assays Positive", "Assays Negative",
"Response Freq.", "Lower Bound of 95% CI",
"Upper Bound of 95% CI"}, {150975, "DTLCIGYHANNSTDT", 18, 32,
"93.33%", 11, 5, 1, 0, 0.45, 0.2, 0.72}, {35073,
"LCLGHHAVPNGTLVKTITNDQIEVTNATELVQSSSTGKI", 20, 58, "30.77%", 1, 1,
1, 0, 1., 0.04, 1.}, {6570,
"CLGHHAVPNGTLVKTITNDQIEVTNATELVQSSSTGKIC", 21, 59, "33.33%", 1, 1,
1, 0, 1., 0.04, 1.}, {191055, "H25, H45, I361, D362", 25, 362,
"100%", 1, 1, 1, 0, 1., 0.04, 1.}, {434783,
"H25, H45, S46, V47, T332, V361, D362, G363, W364, Q381, K382, \
T384, Q385, I388, N389, V395, N396, I399", 25, 399, "94.44%", 1, 1, 1,
0, 1., 0.04, 1.}, {434784,
"H25, H45, V47, N48, L49, T332, D362, G363, W364, Q381, T384, Q385, \
I388, N389, T392, V395, N396, I399, E400", 25, 400, "100%", 1, 1, 1,
0, 1., 0.04, 1.}, {151039, "NSTDTVDTVLEKNVT", 28, 42, "100%", 11, 4,
1, 0, 0.36, 0.13, 0.64}, {417980, "D31, S46", 31, 46, "100%", 1, 1,
1, 0, 1., 0.04, 1.}, {580001,
"D31, H45, S46, V47, T305, S306, T333, V362, D363, W365, L382, \
Q386, V396, N397", 31, 396, "78.57%", 1, 1, 1, 0, 1., 0.04, 1.},...}
If I put it in a TableView[file]
it displays the data correctly. If I extract column 1, elements are formatted correctly in the resulting list. But if I extract column 2, which contains commas, it breaks each row into multiple elements.
How can I get Mathematica to identify each row as it is shown in the table? Those rows with commas would be sublists.