How can I add numbers to the beginning of every line in a file?
E.g.:
This is the text from the file.
Becomes:
000000001 This is 000
Here's a bash script that will do this also:
#!/bin/bash counter=0 filename=$1 while read -r line do printf "%010d %s" $counter $line let counter=$counter+1 done < "$filename"