文件添加行号

# 在每一行的行首,添加宽度为3的行号,并与行内容以“,”隔开
awk '$0=sprintf("%3s", NR)","$0' filename
posted @ 2020-08-04 14:49  delta1037  阅读(99)  评论(0编辑  收藏  举报