Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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__

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://932447]
[1nickt]: The Google-fu is strong with this one.
[1nickt]: I was looking at Best Buy since like the in-store return/repace plan ... but the 17" HP Envy they have is not this one ....
[1nickt]: May be brand new ... 0 reviews on the site.

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2017-03-26 18:14 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (315 votes). Check out past polls.