| [reply] |
There's always a lib. That'll do fine. Would be curious if people know a way to do this without the lib, but this does exactly what I need. Thanks!
| [reply] |
| [reply] [d/l] |
| [reply] |
jdtoronto has the best answer, but you appear to want more (or less ;).
One might think splitting with a regex would work, like this:
@x = split /"?,"?/, $chunk; # broken
but that still splits the quoted field.
Instead you can grab quoted fields and non-quoted fields, and process them separately. However, you quickly get into issues with escaped quotes, negative look-behinds, etc. It gets messy pretty quick, and difficult to maintain.
It's essentially parsing a complex syntax, so let a parser do it :)
-QM
--
Quantum Mechanics: The dreams stuff is made of
| [reply] [d/l] |
A simple way could be to convince Excel to use some other
character (instead of a comma)
for separating fields. A tab is probably a good choice.
| [reply] |
A tab is probably a good choice.
That just makes tabs problematic inside double quotes. Granted, with enough searching and foreknowledge, one can pick a character that never occurs. But never is not as long as we think, and a proven solution is better than a statistical one.
-QM
--
Quantum Mechanics: The dreams stuff is made of
| [reply] |