in reply to Multiple double quotes within csv
This: Field1, ""Quoted String" rest of the data, presumably Field3 is here, Field4 looks odd to me. If there are unbalanced quotes in Field2 like you are showing, that could definitely cause problems. What do you think that the two sequential " characters at the beginning of Field2 mean?
The best would be if you showed a short piece of code that demo'es the exactly your problem and in this case, please specify exactly what the expected output should be. As a suggestion, I would also recommend that you import your CSV into Excel and see what it does with it. You can also use Excel as a "CSV Reference Implementation", enter in a row of data and then see what Excel generates. I have never worked for MS and I am not an Excel "fan". But I have never seen CSV-Text fail to parse something that Excel generated.
At this point, I am not sure whether we are dealing with an improper CSV format or a CSV-Text error or whatever. I have used this CSV module and gotten good results with it. The CSV format is devilishly complicated when weirdo cases are considered. It is best if we can work with a verbatim example, I would put it within <code>..</code> blocks to be sure that everybody is talking about exactly the same thing.
Update: See below post with test case from the OP and others from me. This looks like invalid CSV. With more examples of these invalid lines, I suppose an ad-hoc algorithm can be designed to "fix" the CSV before feeding it into Text-CSV.
|
|---|