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