4 回答
TA贡献1784条经验 获得超9个赞
GNU sed
sed -r ':k;s/-(\s*\S*)$/0\1/g;tk' file
..输出:
1111 1111 exm-IND1-200449980 II
1111 1111 exm-IND1-201453487我0
1111 1111 exm-IND1-85310248 II
1111 1111 exm-IND10-102817747 DD
1111 1111 exm-IND10-18329639 0 D
1111 1111 exm-IND10-27476467 II
1111 1111 exm-IND10-27727540 D 0
TA贡献1808条经验 获得超4个赞
这就是你想要的:
$ awk '$4=="-"{$4=0}$5=="-"{$5=0}{$1=$1}1' OFS='\t' file
1111 1111 exm-IND1-200449980 I I
1111 1111 exm-IND1-201453487 I 0
1111 1111 exm-IND1-85310248 I I
1111 1111 exm-IND10-102817747 D D
1111 1111 exm-IND10-18329639 0 D
1111 1111 exm-IND10-27476467 I I
1111 1111 exm-IND10-27727540 D 0
添加回答
举报