in reply to Re: in file insert character in every row on nth position
in thread in file insert character in every row on nth position

your command works perfectly.any clue how to write this command in a script ?

  • Comment on Re^2: in file insert character in every row on nth position

Replies are listed 'Best First'.
Re^3: in file insert character in every row on nth position
by hippo (Archbishop) on Feb 11, 2016 at 20:29 UTC
    any clue how to write this command in a script ?

    Sure, that's an FAQ.

Re^3: in file insert character in every row on nth position
by Discipulus (Canon) on Feb 12, 2016 at 09:09 UTC
    Let Perl (well B::Deparse ) eplain it to you:
    perl -pi -e "s/^(.{13})/$1:/;" -MO=Deparse BEGIN { $^I = ""; } LINE: while (defined($_ = <ARGV>)) { s/^(.{13})/$1:/; } continue { die "-p destination: $!\n" unless print $_; } -e syntax OK

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.