早教吧作业答案频道 -->其他-->
perl一对多变为一对一原始文件:有两列,以Tab隔开,当然有很多行,我们举其中几行为例:——————————————————————strophanthidinCREBBP,HIF1A,CREB1,EP300,CEBPA,CEBPB,SP1,digoxinCREB
题目详情
perl 一对多变为一对一
原始文件:有两列,以Tab隔开,当然有很多行,我们举其中几行为例:
——————————————————————
strophanthidin CREBBP,HIF1A,CREB1,EP300,CEBPA,CEBPB,SP1,
digoxin CREBBP,CREB1,RPS6KA5,EP300,CEBPA,RPS6KA1,SP1,
hydrastinine NCOA2,CREB1,
puromycin CREBBP,HIF1A,CREB1,CEBPA,CEBPB,
procaine MYOD1,
proscillaridin CREBBP,NCOA2,CREB1,RPS6KA5,EP300,CEBPA,
helveticoside CARM1,CREB1,RPS6KA5,EP300,CEBPA,CEBPB,SP1,
staurosporine CREBBP,CREB1,EP300,CEBPB,
lanatoside_c CREBBP,NCOA2,CREB1,RPS6KA5,EP300,CEBPA,SP1,
digoxigenin CREBBP,NCOA2,CREB1,RPS6KA5,EP300,CEBPA,
……
——————————————————————————
目标:改成一一对应的关系:
——————————————————
strophanthidin CREBBP
strophanthidin HIF1A
strophanthidin CREB1
strophanthidin EP300
strophanthidin CEBPA
strophanthidin CEBPB
strophanthidin SP1
digoxin CREBBP
digoxin CREB1
digoxin RPS6KA5
digoxin EP300
digoxin CEBPA
digoxin RPS6KA1
digoxin SP1
hydrastinine NCOA2
.
————————————————
求,用perl程序怎样简单的实现它?
原始文件:有两列,以Tab隔开,当然有很多行,我们举其中几行为例:
——————————————————————
strophanthidin CREBBP,HIF1A,CREB1,EP300,CEBPA,CEBPB,SP1,
digoxin CREBBP,CREB1,RPS6KA5,EP300,CEBPA,RPS6KA1,SP1,
hydrastinine NCOA2,CREB1,
puromycin CREBBP,HIF1A,CREB1,CEBPA,CEBPB,
procaine MYOD1,
proscillaridin CREBBP,NCOA2,CREB1,RPS6KA5,EP300,CEBPA,
helveticoside CARM1,CREB1,RPS6KA5,EP300,CEBPA,CEBPB,SP1,
staurosporine CREBBP,CREB1,EP300,CEBPB,
lanatoside_c CREBBP,NCOA2,CREB1,RPS6KA5,EP300,CEBPA,SP1,
digoxigenin CREBBP,NCOA2,CREB1,RPS6KA5,EP300,CEBPA,
……
——————————————————————————
目标:改成一一对应的关系:
——————————————————
strophanthidin CREBBP
strophanthidin HIF1A
strophanthidin CREB1
strophanthidin EP300
strophanthidin CEBPA
strophanthidin CEBPB
strophanthidin SP1
digoxin CREBBP
digoxin CREB1
digoxin RPS6KA5
digoxin EP300
digoxin CEBPA
digoxin RPS6KA1
digoxin SP1
hydrastinine NCOA2
.
————————————————
求,用perl程序怎样简单的实现它?
▼优质解答
答案和解析
#!/usr/bin/perl -wuse strict;die "perl $0 \n" unless(@ARGV == 1);open IN,$ARGV[0];while(){ chomp; my @tmp=split /[ \t,]+/,$_; for(my $i = 1;$i
看了perl一对多变为一对一原始文...的网友还看了以下:
一篇文章原稿每行30个字,共96行,如果改为每行32个字,一页纸35行排版,那么这篇文章需打印几行 2020-04-25 …
现在有一些名词我听不懂,比如伴随状语是什么,举几个例子逻辑主语是什么,举几个例子还有,状语和副词都 2020-05-13 …
在古诗词中请举几个互文和借代的例子1.举几个互文和借代的例子,十个左右,不要太多也不要太少,借代要 2020-07-08 …
原电池的正极材料有没有可能参与原电池的电极反应,试举例举几个c作为电极,与c反应的原电池 2020-07-29 …
这个语法问题我一直搞不明白what引起的主语从句:whatisneededisgreatersafe 2020-11-03 …
1.家用电器展销会上,某款电热水器举行促销活动.大减价,原价800元,现价640元.(1).现价是原 2020-11-13 …
如何判断一个人是否在说谎,从他的言行举止中怎么知道?我有一次,我一个朋友在说谎,然后过了几天,被我揭 2020-11-23 …
在古诗词中请举几个互文和借代的例子1.举几个互文和借代的例子,十个左右,不要太多也不要太少,借代要有 2020-12-01 …
试对超重、失重进行受力分析,并举几个Example?请不要...试对超重、失重进行受力分析,并举几个 2020-12-02 …
中国共举行过几次世博会?我是初三学生,今年二模刚考到这个时政题,有人说2010是中国举办的第二次世博 2021-01-27 …