Thanks Chris,

I am using PDL 2.4.7. I do get the same output as you do when I use 

P join "\n", rcols 'filename.txt',0,1,2,3,8,
{INCLUDE=>'/^\s+\d\t\d\t\d+\t\w+\t\d\tlocked\s+combined\s+\d+\t\-\d+\.\d+\s+\d+\t\d+\t0x[0-f]+$/',
PERLCOLS => [ 3 ]}  

Reading data into piddles of type: [ Double Double Double Double ]
Read in 63227 elements.
TOO LONG TO PRINT
TOO LONG TO PRINT
TOO LONG TO PRINT
ARRAY(0x53452b4)
TOO LONG TO PRINT

When I place in the variables now and print $sector I get :
pdl> p "$sector"
ARRAY(0x3c015c4)

And I finally figured out how to delimit the array to print it.
pdl> p "@$sector[0]"
Alpha

Thank you all. 

CLIFF SOBCHUK
Core RF Engineering
Phone 613-667-1974   ecn: 8109-71974
mobile 403-819-9233
yahoo: sobchuk
www.ericsson.com 

"The author works for Telefonaktiebolaget L M Ericsson ("Ericsson"), who is 
solely responsible for this email and its contents. All inquiries regarding 
this email should be addressed to Ericsson. The web site for Ericsson is 
www.ericsson.com."

This Communication is Confidential. We only send and receive email on the basis 
of the terms set out at www.ericsson.com/email_disclaimer


-----Original Message-----
From: Chris Marshall [mailto:[email protected]] 
Sent: May-19-11 12:06 PM
To: Clifford Sobchuk
Cc: [email protected]
Subject: Re: [Perldl] Using rgrep multiple times on the same file

Clifford Sobchuk writes:
>
> 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.

Hi Cliff-

Are you using the latest PDL?  The PERLCOLS support in rcols() should allow you 
to get any columns you select as a ref to a perl array rather than a piddle:

pdl> # cat eg.cols
 1      1       11      one     1       oneone  1       oneoo  111      -1.1  
1111
 2      2       22      one     2       oneone  2       oneoo  222      -2.2  
2222
 3      3       33      one     3       oneone  3       oneoo  333      -3.3  
3333
 4      4       44      one     4       oneone  4       oneoo  444      -4.4  
4444
 5      5       55      one     5       oneone  5       oneoo  555      -5.5  
5555

Without PERLCOLS you get this

pdl> p join "\n", rcols 'eg.cols', { INCLUDE=>'/^\s+\d\t\d/' }
Reading data into piddles of type: [ Double Double Double Double Double Double 
Double Double Double Double Double ] Read in 5 elements.
[1 2 3 4 5]
[1 2 3 4 5]
[11 22 33 44 55]
[0 0 0 0 0]
[1 2 3 4 5]
[0 0 0 0 0]
[1 2 3 4 5]
[0 0 0 0 0]
[111 222 333 444 555]
[-1.1 -2.2 -3.3 -4.4 -5.5]
[1111 2222 3333 4444 5555] 

But with PERLCOLS you get this

pdl> p join "\n", rcols 'eg.cols', { INCLUDE=>'/^\s+\d\t\d/', 
pdl> PERLCOLS=>[3,5,7] }
Reading data into piddles of type: [ Double Double Double Double Double Double 
Double Double ] Read in 5 elements.
[1 2 3 4 5]
[1 2 3 4 5]
[11 22 33 44 55]
ARRAY(0x3821050)
[1 2 3 4 5]
ARRAY(0x3821938)
[1 2 3 4 5]
ARRAY(0x3821488)
[111 222 333 444 555]
[-1.1 -2.2 -3.3 -4.4 -5.5]
[1111 2222 3333 4444 5555] 

Cheers,
Chris




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

Reply via email to