Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How to parse this file

by jwkrahn (Monsignor)
on Oct 19, 2011 at 17:03 UTC ( #932447=note: print w/ replies, xml ) Need Help??


in reply to How to parse this file

#!/usr/bin/perl use warnings; use strict; use Scalar::Util qw/ looks_like_number /; my ( $file_in, $file_out ) = ( 'file1.txt', 'file2.txt' ); open my $IN, '<', $file_in or die "Cannot open '$file_in' because: $ +!"; open my $OUT, '>', $file_out or die "Cannot open '$file_out' because: +$!"; while ( <$IN> ) { print $OUT join( "\t", grep looks_like_number( $_ ), split ), "\n" +; } __END__


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://932447]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2014-09-02 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (19 votes), past polls