On 5/19/11 1:39 PM, Clifford Sobchuk wrote:
I found a couple of problems in my rcols format and the regexp and have 
corrected that so that rcols responds without error. I missed that the INCLUDE 
is just the filter and had the listed the columns as per the groupings, and I 
had forgotten the PERLCOL in the column identifiers.

($val1, $val2, $val3, $name, $val4) = rcols ('filename.txt' ,\
0,1,2,3,8, { 
INCLUDE=>'/^\s+\d\t\d\t\d+\t\w+\t\d\t\w+\s+\w+\s+\d+\t\-\d+\.\d+\s+\d+\t\d+\t0x[0-f]+$/',\
PERLCOLS =>  [ 3 ]})

It does capture all of the numeric data. I still can't get the name though. Do 
I have to specify that the PERLCOL is a string somehow?


From

http://pdl.perl.org/?docs=IO/Misc&title=PDL::IO::Misc%20documentation#rcols__

and from how I originally wrote it (may have been changed later though), the $name array has to come at the end and you don't include it in the original column list - e.g. something like

($val1,$val2,$val4,$val4,$name) = rcols('foo.txt',0,1,2,8, {
  INCLUDE => '/sooper-dooper-regex/',
  PERLCOLS => [3]})

is what I'd expect to work.

HTH,
Doug


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to