in reply to extract string columns with perl

> Hope this is clear,

not really, and not CSV (comma separated)

That's what you want?

DB<107> $str =~ s/^""//; # remove start => 1 DB<108> $str =~ s/""$//; # remove end => 1 DB<109> @result = split /" "/, $str # separate quotepairs => ( 6357445, 1349947, 0, 1, 3, 2, 1, 1, 1, 1, -2, 1394531830, 1394531830, 1415599200, 0, 0, 0, 0, 196, 29240, 378, 1394531846, 0, 0, 0, 8201, 0, 64, 0, 2, 89799, 8201, 89805, -1, -1, "Local Cell id=2, Cell Name=21842C11", 0, 1394531057, 1394531057, 1415599200, 1394531092, "", 0, "RAT_INFO=GL, AFFECTED_RAT=L", "", "", "10.35.201.146", "195;", 0, 5705354, 0, "", "", 0, 0, "Cell", )

Cheers Rolf

( addicted to the Perl Programming Language)

update

the OP was updated with code-tags, such that now the fields are separated by many whitespaces. to make my code work use split /"\s+"/ now.

Replies are listed 'Best First'.
Re^2: extract string columns with perl
by juanito23 (Novice) on Apr 16, 2014 at 08:06 UTC
    Hi, this looks to be close to what I need, so I will work on it. I think the issue is with the data extraction from csv file, since if I assign the whole string to a variable in perl, I will get much better result. Thanks!