1、
[root@centos79 test]# cat a.txt test3_1_clean.fq.gz test3_2_clean.fq.gz test4_1_clean.fq.gz test4_2_clean.fq.gz test5_1_clean.fq.gz test5_2_clean.fq.gz [root@centos79 test]# awk '{OFS = " "}{split($1,x,"_"); print x[1], x[3], $1, $2}' a.txt test3 clean.fq.gz test3_1_clean.fq.gz test3_2_clean.fq.gz test4 clean.fq.gz test4_1_clean.fq.gz test4_2_clean.fq.gz test5 clean.fq.gz test5_1_clean.fq.gz test5_2_clean.fq.gz