Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: One-liner to append text at fixed column

by jwkrahn (Abbot)
on Nov 15, 2018 at 22:51 UTC ( [id://1225884]=note: print w/replies, xml ) Need Help??


in reply to One-liner to append text at fixed column

perl -lne 'printf "%-48s%s\n", $_, /(^#|nextstate|var\d+)/ ? " #:$1" +: ""'

Replies are listed 'Best First'.
Re^2: One-liner to append text at fixed column
by LanX (Saint) on Nov 15, 2018 at 22:58 UTC
    ah yes -l for chomp. Thanks! :)

    |perl -lpe '$_= sprintf "%-48s  #:$1",$_ if /(^#|nextstate|var\d+)/'

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-26 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found