Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How to parse this file

by roboticus (Canon)
on Oct 19, 2011 at 14:53 UTC ( #932427=note: print w/ replies, xml ) Need Help??


in reply to How to parse this file

hervebags:

I'd do it something[1] like this:

my @cols_to_keep = (0, 2, 3, 5, 6, 8 .. 18); while (my $line = readline(ARGV)) { my @fields = split /\s+/, $line; print FILE2 join(" ", @fields[@cols_to_keep]), "\n"; }

[1] i.e., untested, etc.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


Comment on Re: How to parse this file
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://932427]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (16)
As of 2014-10-30 18:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls