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
with linebreaks
here"
"####","more text data", "more data
with
linebreaks
here"
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…