TimGurney
9/28/2015 - 10:22 PM

This is a very simple Perl one liner to prefix every line in a given file with a given string.

This is a very simple Perl one liner to prefix every line in a given file with a given string.

perl -pe 's/(.*)/string $1/' infile > outfile

This is a very simple Perl one liner to prefix every line in a given file with a given string. Simply change the 'string' to be the string you wish to prefix the lines with.