I have a csv file with 3 columns. Fields are comma delimited and strings are enclosed with quotation marks "". About 40% of the time, the line of values will start a new line thanks to carriage return characters within a string.
for the sample input that was given in the first post in this thread. You have to choose whether you want "strawberry" and "123 Maple St.Apt. C." OR "straw berry" and "123 Maple St. Apt. C." . If you want "strawberry" and "123 Maple St. Apt. C." , you need to specify the logic that should be used to determine when a space is needed and when it isn't.
Note also that in koeji's original post explicitly stated: "I have a csv file with 3 columns." , but the "actual sample" provided in a later post has:
"Doe", "John", "N", "123 Maple St.
Apt. C."
which not only has 4 fields (instead of 3), but also has <comma><space> separated fields instead of <comma> separated fields.
With the original problem statement, I had considered pairing three sets of <double-quote> characters instead of just looking for lines that didn't start with a <double-quote>. In the future, please post real examples, instead of simplified examples that don't match the actual input you expect to be processing.
Thanks to all. While I could not provide actual examples due to the content, I should have been more clear in the requirements and provided a better example. It has helped my learning tremendously.