我想在打印每行后输出txt文件中每行的字符数。我使用的awk脚本是:
marks.txt文件的内容为:
输出结果为:
awk 'length($0)>19{print length($0)}' marks.txt
但它没有打印每行的字符数。输出中在打印文件内容后有一个0,但这不是我需要的。请问我做错了什么?谢谢!marks.txt文件的内容为:
1) Amit Physics 80
2) Rahul Maths 90
3) Shyam Biology 87
4) Kedar English 85
5) Hari History 89
输出结果为:
1) Amit Physics 80
2) Rahul Maths 90
3) Shyam Biology 87
4) Kedar English 85
5) Hari History 89
0
length($0)>19
会做什么? - Ed Morton