On 5/18/11 10:46 PM, Clifford Sobchuk wrote:
Using rgrep to capture the first 4 fields and the 9th field. The data is
intermixed with other data in the file so I can't use rcols.

Cliff,

Can you use the INCLUDE or EXCLUDE options of rcols to filter out the unwanted lines (e.g. use something like


INCLUDE=>'/^\s+(\d)\t(\d)\t(\d+)\t(\w+)\t\d\t\w+\s+w+\s+\d+\t(\-\d+\.\d+)\s+\d+\t\d+.*/'

), or am I just being dense and this is a spectacularly-stupid idea ;-)

I was also going to suggest doing a "pre-filter" stage, whereby you read in the file and filter out all the unwanted lines before using rcols or rgrep, but then I remembered that my perl-fu has all leaked away and I can't remember if you can treat a string as a filehandle (as I think rcols/rgrep require); I'm sure there's away but I don't know it off hand.

Doug

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

Reply via email to