Was trying to figure out how to insert line numbers into a huge file with sed or awk, then stumbled across “nl”, a sweet little baby that comes with GNU coreutils and numbering files is what it does for a living. GNU coreutils is full of gems!
Boring:
ak@gd:~$ cat file blah blah blah bleh blah
Awesome:
ak@gd:~$ cat file | nl -n ln -w1 -s\| 1|blah 2|blah blah 3|bleh blah