Help splitting a comma-separated string but ignoring commas in quotes.
in
Programming Questions
•
3 months ago
I have a CSV formated like this:
- 20120807,1200,"I can't sleep, too much caffeine.",476,100,375,187,411,347,175
- 20120807,1300,I like bagels,476,101,375,187,431,347,175
- 20120807,1300,The man said he had "powers",476,101,375,187,431,347,175
- 20120807,1300,"And the he said, "I hate you."",476,101,375,187,431,347,175
- String[] lines = loadStrings("data.csv");
- String[] peices = split(lines[0], ",");
I've dug around on the web but didn't find anything. If anyone knows how to do this I would really appreciate the help!
1