如何将数字添加到文件中每一行的开头?
E.g.:
This is
the text
from the file.
Becomes:
000000001 This is
000000002 the text
000000003 from the file.
不要使用 cat 或任何其他不是为此目的设计的工具。使用该程序:
nl - 文件行数
Example:
$ nl --number-format=rz --number-width=9 foobar
$ nl -n rz -w 9 foobar # short-hand
因为 nl 就是为此而生的;-)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)