I'm attempting to parse a set of CSV data using PHP, but having a major issue. One of the fields is a long description field, which itself contains linebreaks within the enclosures.
My primary issue is writing a piece of code that can split the data line by line, but also recognize when linebreaks within the data should not be used. The linebreaks within this field are not properly escaped, making them hard to distinguish from legitimate linebreaks.
I've tried to come up with a regular expression that can properly handle it, but had no luck so far. Any ideas?
CSV format:
"####","text data here", "text data \n with linebreaks \n here"\n