dsheroh has asked for the wisdom of the Perl Monks concerning the following question:
I have a data file that looks something like this:
"72 3267S" "S2079" 1 no
"72 0250" "S3011" 1 no
"72 8351S" "S6101" 1 no
"72 17082S" "S6108" 1 no
Space-delimited, with the possibility of spaces in the data and surrounded by double quotes. (This sample has a space in the first column of every row and none in the second column, but this cannot be relied on in general.)
I figure there's got to be a way to do this other than building a state machine and walking the string a character at a time but split/regexes aren't up to the task. So what's the preferred method?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Splitting strings with enclosed delimiters
by insensate (Hermit) on Oct 03, 2002 at 18:31 UTC | |
by dsheroh (Monsignor) on Oct 03, 2002 at 18:40 UTC | |
|
Re: Splitting strings with enclosed delimiters
by fglock (Vicar) on Oct 03, 2002 at 18:26 UTC | |
|
Re: Splitting strings with enclosed delimiters
by Corion (Patriarch) on Oct 03, 2002 at 18:29 UTC | |
by merlyn (Sage) on Oct 03, 2002 at 18:45 UTC | |
|
Re: Splitting strings with enclosed delimiters
by hossman (Prior) on Oct 03, 2002 at 21:43 UTC | |
|
Re: Splitting strings with enclosed delimiters
by flounder99 (Friar) on Oct 03, 2002 at 21:29 UTC |