Add line numbers to a file (Four digits, leading zeros, separated by a colon):
nl -i1 -s': ' -nrz -w4 cotus.txt
awk '{printf"%04d: ",NR;print}' cotus.txt
Oh wait, you don’t want to count the blank lines?
awk '/[^ ]/{printf"%04d: ",++n}{print}' cotus.txt
Oh wait, you only want the first 30 lines?
awk '/[^ ]/{printf"%04d: ",++n}{print}NR==30{exit}' cotus.txt