I am trying to parse a CSV. I would like to get it in the database or just parse it using JavaScript, but in any case it crashes due to broken syntax. The entire CSV file is here:
https://gist.github.com/1023560
If you notice, it breaks where double quotes have double quotes, and it also fails when pasting into MySQL. The first gap is shown on line 13. It is interrupted and instead of returning a full one:
<a href="http://www.facebook.com/pages/Portland-Community-Gardens/139244076118027?v=wall" target="_blank"><img src="/shared/cfm/image.cfm?id=348340" alt="Facebook" width="100" height="31" /></a>
It returns:
<a href="
For JavaScript, I was going to just use CSVToArray () from Ben Nadel:
http://www.bennadel.com/blog/1504-Ask-Ben-Parsing-CSV-Strings-With-Javascript-Exec-Regular-Expression-Command.htm
My ultimate goal is to put in MySQL so that I can respond to the JSON feed using PHP json_encode() .
All I noticed can be problematic is that double quotes can be in HTML tags as above, but also as HTML text tag tags, so "<span class="text">"Example"</span>"
The first set of quotes is a CSV column, the second is HTML quotes, and the third is text quotes.
source share