Theodoros Emmanouilidis

Notes & Thoughts

awk Script That Adds Specified Prefix To Each Line


This is a useful awk script that adds specified prefix to each line of a given text file.

awk -v PRE='THE_PREFIX_THAT_YOU_WANT' '{$0=PRE$0; print}' my_input_file.txt > my_output_file.txt

It’ s so simple with awk!

posted under Tip Of The Day