====== AWK - Number only non-blank lines in files ====== awk 'NF { $0=++a " :" $0 }; { print }' file.txt