Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Simple perl one-liner for transforming text files

by DaveH (Monk)
on Mar 06, 2003 at 01:08 UTC ( #240768=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -F: -al0ne '$i||=1;/^n/&&print$i;!/^u/&&print$F[1];/^$/&&$i++&&pr
    +int$/'
    
  2. or download this
    LINE: while (defined($_ = <ARGV>)) {
        chomp $_;
    ...
        print $F[1] if not /^u/;
        print $/ if /^$/ and $i++;
    }
    
  3. or download this
    perl '-F: ' -al0ne '!/^u/&&print qq($F[1] );/^$/&&print$/'
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2023-10-04 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?