How to prepend a character to start of each line in 250,000+ line file using a script

applescriptautomatorbashcommand linezsh

I have text file with 250,000 lines – and I need to append the same single character at the start of each line. I have tried to use various multiline /column edit plugins in Atom and Sublime but they just hang – I guess due to size of file.

Is this something I could do with with a bash/zsh script – or AppleScript/Automator maybe ?

Best Answer

Prepend each line of a file with a capital A and write a new file-

awk '{print "A"$0}' < FILE > NEWFILE