line1this is line1line2this is line2line3this is line3
我想使用awk或sed删除每个备用行的尾随换行符,以便像这样合并它们
line1: this is line1 line2: this is line2line3: this is line3
我怎么用awk或sed做到这一点
解决方法$cat input line1this is line1line2this is line2line3this is line3$awk 'NR%2==1 {prev=} NR%2==0 {print prev ": " } END {if (NR%2==1) {print ":"}}' inputline1: this is line1line2: this is line2line3: this is line3$总结
以上是内存溢出为你收集整理的sed – 处理备用线bash全部内容,希望文章能够帮你解决sed – 处理备用线bash所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)