spacegeologist has asked for the wisdom of the Perl Monks concerning the following question:
I am using split to separate array elements. The data looks like this:
1, 2, 3,"a,b,c","d", 4, ect...
I need it to be separated like this:
1
2
3
a,b,c
d
4
I've tried split /,\s+|,"/ but the results are inconsistent. I need use commas as the delimiter except when they are surrounds by quotes. Any ideas?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Incosistent delimeter
by toolic (Bishop) on Apr 21, 2011 at 01:48 UTC | |
|
Re: Incosistent delimeter
by trwww (Priest) on Apr 21, 2011 at 02:25 UTC | |
|
Re: Inconsistent delimeter
by cmac (Monk) on Apr 21, 2011 at 02:30 UTC |