Adding a character to a line using Perl

perl -p -i -e 's/(.)$/$1$1/g' filename 

This changed my nonsense file: 

ghggk dethaks gjfkdld fyduftsdu flkgjd kflgjlk flkgjl f 

into a slightly different nonsense file: 

ghggkk dethakss gjfkdldd fyduftsduu flkgjd kflgjlk flkgjl ff  
This entry was posted in coding. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>