But Text::CSV will not help very much with the type of data shown in the original post, will it?
AFAIK, it will also break on an additional comma unless there is some additional information, such as quotes, to help identify that the additional comma is not a field separator.
| [reply] |
Yes.
If the CSV is well-formed, internal commas will be escaped in some way, eg:
Ed Smith, "Smith, Brown & Jones", sbj@example.com, "999,999,999"
Of course, if it isn't well-formed, I agree that Text::CSV will not help any more than a hand-rolled CSV parsing kludge...
| [reply] [d/l] |
I'd say at this point, we just don't have enough info about the actual data and where it comes from. I am working with one CSV file now and I had a choice of the separator character and chose the pipe, "|", instead of comma ",". We've got a case here where the example data probably doesn't come close enough to the "real thing". The original code didn't come close to working either. If this is a "real" CSV, then Text_CSV will help.
| [reply] |