【发布时间】:2016-08-08 11:09:17
【问题描述】:
我有一个制表符分隔的文件,如下 -
loci1 loci2 name1 name2
utr3p utr3p TERF1 ISCA2
utr3p intron LPP PAAF1
utr3p intron RPL37A RCC1
coding intron BAG2 RP11
intron intron KIF1B SNORA21
intron downstream GUSBP4 CTD
intron intron CLTC VMP1
utr3p utr3p PCYT1A ZHX3
我想连接两列 name1 和 name2(由“__”连接)。合并的列应作为新列“merged_names”粘贴到新文件中。我怎样才能使用 awk 来做到这一点。
预期输出 -
loci1 loci2 name1 name2 merged_names
utr3p utr3p TERF1 ISCA2 TERF1__ISCA2
utr3p intron LPP PAAF1 LPP__PAAF1
utr3p intron RPL37A RCC1 RPL37A__RCC1
coding intron BAG2 RP11 BAG2__RP11
intron intron KIF1B SNORA21 KIF1B__SNORA21
intron downstream GUSBP4 CTD GUSBP4__CTD
intron intron CLTC VMP1 CLTC__VMP1
utr3p utr3p PCYT1A ZHX3 PCYT1A__ZHX3
【问题讨论】:
-
家庭作业?