在我拥有的所有文件的第11列中,我想删除最后一位数 - 一个0.我不知道如何快速完成此操作?
输入文件示例
chr1 13281 C G 20 4 16.670 S 28 3 9.680 S Germline 0.006377004201320391 0.8803370017576622 19 9 2 1
chr1 13302 C T 12 10 45.450 Y 20 11 35.480 Y Germline 3.992679813441744E-8 0.8451888548995793 13 7 9 2
chr1 13402 G C 114 0 00 G 153 2 1.290 S Somatic 1.0 0.3311046995506439 139 14 1 1
chr1 136048 C T 19 12 38.710 Y 32 7 17.950 Y Germline 4.6433264291396187E-7 0.98655920157275 15 17 2 5
chr1 871269 A C 12 2 14.290 M 26 2 7.140 M Germline 0.058009817045962773 0.9000000000000099 4 22 0 2
chr1 881627 G A 0 31 1000 A 0 43 1000 A Germline 4.280406726905674E-44 1.0 21 22
输出
chr1 13281 C G 20 4 16.670 S 28 3 9.68 S Germline 0.006377004201320391 0.8803370017576622 19 9 2 1
chr1 13302 C T 12 10 45.450 Y 20 11 35.48 Y Germline 3.992679813441744E-8 0.8451888548995793 13 7 9 2
chr1 13402 G C 114 0 00 G 153 2 1.29 S Somatic 1.0 0.3311046995506439 139 14 1 1
chr1 136048 C T 19 12 38.710 Y 32 7 17.95 Y Germline 4.6433264291396187E-7 0.98655920157275 15 17 2 5
chr1 871269 A C 12 2 14.290 M 26 2 7.14 M Germline 0.058009817045962773 0.9000000000000099 4 22 0 2
chr1 881627 G A 0 31 1000 A 0 43 100 A Germline 4.280406726905674E-44 1.0 21 22
答案 0 :(得分:3)
你可以使用awk,
awk '{sub(/[0-9]$/, "", $11)}1' file
答案 1 :(得分:0)
sed 's/\(\([^[:space:]]\{1,\}[[:space:]]\{1,\}\)\{10\}[^[:space:]]*\)0/\1/' YourFile
-i
选项(在这种情况下由于GNU sed而导致--POSIX
)