有如下的文本内容:
*********
123123
123123
*********
321321
321321
*********
456456
456456
*********
123123
123123
********
匹配123,取出******区间的内容:
awk -vRS="*+" '/123/{print RT$0}' file
说明:
RS The input record separator, by default a newline(\n).
RT The record terminator. Gawk sets RT to the input text that matched the character or regular expression specified by RS.
最后
以上就是优美篮球最近收集整理的关于awk区间取值的例子的全部内容,更多相关awk区间取值内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复