001、
(base) [b20223040323@admin2 test]$ ls a.txt (base) [b20223040323@admin2 test]$ cat a.txt ## 测试数据 gene exon exon exon exon -------- gene exon exon -------- gene exon exon exon exon ## 将多个连续的exon压缩为单个exon (base) [b20223040323@admin2 test]$ awk '{if($1 == "exon") {sum++} else {sum = 0}; if(sum > 1) {next} else {print $0}}' a.txt gene exon -------- gene exon -------- gene exon
。
标签:--------,字符,txt,列中,admin2,exon,linux,test,gene From: https://www.cnblogs.com/liujiaxin2018/p/17533840.html