Murray McGillivray wrote:
Folks, I have a number of text files of poetry that I'd like to add line numbers to for concordancing, starting the numbering at 1 and continuing to the last text line, with the line numbers ending up as part of the resulting text file, each number on the relevant line before the text of that line of verse begins.
The following bit of perl magic will do it
perl -pi -e"s/$_/$. $_/" filename