Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: How do i extract 3 variables from each line in a file, and print them to a new file

by Transient (Hermit)
on Jul 08, 2005 at 16:56 UTC ( #473498=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    __DATA__
    3434 34456 7788 9999 65444 4 444 444 44443225 12ms:233ms:455ms
    755655 5789 333 666776 5553 353534 33 321ms:543ms:45ms
    
  2. or download this
    perl -pe '$_=join(",",map{s/\D//g;$_} split(":",(split(" ",$_))[-1])).
    +"\n"' < input > output
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2020-05-31 11:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (173 votes). Check out past polls.

    Notices?