Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: perl to run awk and sed

by runrig (Abbot)
on Nov 30, 2015 at 21:08 UTC ( [id://1148967]=note: print w/replies, xml ) Need Help??


in reply to perl to run awk and sed

If you want to convert awk or sed to perl, a2p and s2p can do that for you. You can use the results as is, or just get an idea of how to do something in perl. E.g. for your awk, a2p gives:
$, = ' '; # set output field separator $\ = "\n"; # set output record separator $FS = "\t"; ; while (<>) { chomp; # strip record separator ($Fld1) = split($FS, $_, -1); print $Fld1; }
s2p outputs more cruft, but the important bit is just 's/.$//', which can be inserted into the above script.

Replies are listed 'Best First'.
Re^2: perl to run awk and sed
by kcott (Archbishop) on Dec 01, 2015 at 03:33 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-04-25 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found