Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: How to parse this file

by roboticus (Chancellor)
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 surveying the Monastery: (3)
As of 2015-07-06 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls