Add numbers to the beginning of every line in a file

后端 未结 7 1698
暗喜
暗喜 2020-12-01 02:44

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         


        
相关标签:
7条回答
  • 2020-12-01 03:27
    perl -pe 'printf "%09u ", $.' -- example.txt
    
    0 讨论(0)
提交回复
热议问题