in reply to Oneliner with substring trimming and padding
Try eval (I've added needed additional parens around second matching group):
perl -pi -e 'substr($_,589,35) =~ s/(0*)((\w+)*)/$2.(' ' x length($1))/e if /^(.{589})(0{1,34})/' file.txt
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Oneliner with substring trimming and padding
by Neighbour (Friar) on Jul 17, 2012 at 12:17 UTC | |
by tobyink (Canon) on Jul 17, 2012 at 18:59 UTC |
In Section
Seekers of Perl Wisdom