0
同一個詞這是製表input.tsv打印在某些列中同時有空白字段下方先後在UNIX
rs928302 YES TMPRSS3 rf G V 53 NM_001256317.1 NP_001243246.1
rf G V 53 NM_024022.2 NP_076927.1
rf G V 53 NM_032405.1 NP_115781.1
rs1046210 YES BACE2 rf C D 364 NM_012105.4 NP_036237.2
rf C D 364 NM_138992.2 NP_620477.1
rf C D 269 XM_017028314.1 XP_016883803.1
rs1064579 YES IFNGR2 rf T V 272 NM_001329128.1 NP_001316057.1
rf T V 253 NM_005534.3 NP_005525.2
rf T V 272 XM_005260969.2 XP_005261026.1
rf T V 278 XM_011529553.1 XP_011527855.1
rf T V 255 XM_011529554.2 XP_011527856.1
一個縮減的和我想在空白字段打印在上面發現了相同的字和適用於第一列,第二列和第三列直到文件結束。當出現不同的單詞時,下面的打印應該是這個新單詞,等等。所以輸出應該是:
rs928302 YES TMPRSS3 rf G V 53 NM_001256317.1 NP_001243246.1
rs928302 YES TMPRSS3 rf G V 53 NM_024022.2 NP_076927.1
rs928302 YES TMPRSS3 rf G V 53 NM_032405.1 NP_115781.1
rs1046210 YES BACE2 rf C D 364 NM_012105.4 NP_036237.2
rs1046210 YES BACE2 rf C D 364 NM_138992.2 NP_620477.1
rs1046210 YES BACE2 rf C D 269 XM_017028314.1 XP_016883803.1
rs1064579 YES IFNGR2 rf T V 272 NM_001329128.1 NP_001316057.1
rs1064579 YES IFNGR2 rf T V 253 NM_005534.3 NP_005525.2
rs1064579 YES IFNGR2 rf T V 272 XM_005260969.2 XP_005261026.1
rs1064579 YES IFNGR2 rf T V 278 XM_011529553.1 XP_011527855.1
rs1064579 YES IFNGR2 rf T V 255 XM_011529554.2 XP_011527856.1
在Unix環境下怎麼做呢?提前致謝。
它工作正常!非常感謝 –