awk
文章平均质量分 65
假装80后
一个不念过去,不畏将来的程序员
展开
-
awk merge lines
A sample to merge continuous text line using awk utility. i.e, when a text line is ended with a dash ('-'), it should continue with next line. For example: 1: 11 2: 22 - 3: 33 4:原创 2016-10-17 22:52:10 · 503 阅读 · 0 评论 -
awk check text file line-by-line
For example; using awk to check whether a text file has exactly following 3 lines: AA BB CC cat $infile | awk ' BEGIN { retcode = 0; rowcount = 3 } NR==1 { if ( $0 != "AA") { retco原创 2016-10-16 12:34:36 · 265 阅读 · 0 评论