关于perl的问题现有a文件100:00:16,000 --> 00:00:19,000When I was 10 years old,200:00:19,000 --> 00:00:22,000a cousin of mine took me on a tour of his medical school.300:00:22,000 --> 00:00:24,000And as a special treat400:00:24,000 --> 00:00:2

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/03 17:13:47
关于perl的问题现有a文件100:00:16,000 --> 00:00:19,000When I was 10 years old,200:00:19,000 --> 00:00:22,000a cousin of mine took me on a tour of his medical school.300:00:22,000 --> 00:00:24,000And as a special treat400:00:24,000 --> 00:00:2

关于perl的问题现有a文件100:00:16,000 --> 00:00:19,000When I was 10 years old,200:00:19,000 --> 00:00:22,000a cousin of mine took me on a tour of his medical school.300:00:22,000 --> 00:00:24,000And as a special treat400:00:24,000 --> 00:00:2
关于perl的问题
现有a文件
1
00:00:16,000 --> 00:00:19,000
When I was 10 years old,
2
00:00:19,000 --> 00:00:22,000
a cousin of mine took me on a tour of his medical school.
3
00:00:22,000 --> 00:00:24,000
And as a special treat
4
00:00:24,000 --> 00:00:26,000
he took me to the pathology lab
5
00:00:26,000 --> 00:00:28,000
and took a real human brain
6
00:00:28,000 --> 00:00:30,000
out of the jar
7
00:00:30,000 --> 00:00:32,000
and placed it in my hands.
b文件
1
00:00:16,000 --> 00:00:19,000
我十岁的时候
2
00:00:19,000 --> 00:00:22,000
我的一个表兄带我参观了他上的医学院
3
00:00:22,000 --> 00:00:24,000
作为一次特别优待
4
00:00:24,000 --> 00:00:26,000
他带我去了病理学实验室
5
00:00:26,000 --> 00:00:28,000
拿出一个真正的人脑
8
00:00:28,000 --> 00:00:30,000
从一个罐子里
9
00:00:30,000 --> 00:00:32,000
把它放在了我手里
然后将a文件以句号为分割,时间轴合并,提取出了
c文件
1
00:00:16,000 --> 00:00:22,000?1
When I was 10 years old,
a cousin of mine took me on a tour of his medical school.
2
00:00:22,000 --> 00:00:32,000
And as a special treat
he took me to the pathology lab
and took a real human brain
out of the jar
and placed it in my hands.
怎么从b文件中提取出与c文件对应的中文文本d文件呢,时间轴以英文a文件的为依据如下:
d文件
1
00:00:16,000 --> 00:00:22,000?1
我十岁的时候,
我的一个表兄带我参观了他上的医学院.
2
00:00:22,000 --> 00:00:32,000
作为一次特别优待,
他带我去了病理学实验室,
拿出一个真正的人脑,
从一个罐子里,
把它放在了我手里.
暂时先这么多分,好的话,一定会再加的,

关于perl的问题现有a文件100:00:16,000 --> 00:00:19,000When I was 10 years old,200:00:19,000 --> 00:00:22,000a cousin of mine took me on a tour of his medical school.300:00:22,000 --> 00:00:24,000And as a special treat400:00:24,000 --> 00:00:2
#!/usr/bin/perl
#abcd.pl
my ($i,$num,$file)=(1,0,'');
open A,"afile";
while(){ push @index,$. if /\.$/ }
open B,"bfile";
my @B=;
$B[($_ - 1)] =~ s/$/./ for @index;
$file .= $_ for @B;
my @D=split/\./,$file;
for (@D){
/^(\d\d:.*?) -->(?:.*)* (\d\d.*?\d)$/sm;
my ($t1,$t2)=($1,$2);
s/^\d+(:.*)?$//gm;
s/\n+/\n/mg;
s/^(\D.*\D)$/$1,/mg;
s/,$/./;
print ++$num,"\n","$t1 --> $t2",$_,"\n";
}

perl abcd.pl
1
00:00:16,000 --> 00:00:22,000
我十岁的时候,
我的一个表兄带我参观了他上的医学院.
2
00:00:22,000 --> 00:00:32,000
作为一次特别优待,
他带我去了病理学实验室,
拿出一个真正的人脑,
从一个罐子里,
把它放在了我手里.
正则表达式是 Perl 语言的一大特色,也是 Perl 程序中的一点难点,不过如果能够很好的掌握他,就可以轻易地用正则表达式来完成字符串处理的任务,当然在设计中就更能得心应手了.
perl菜鸟,请指教

关于perl的问题现有a文件100:00:16,000 --> 00:00:19,000When I was 10 years old,200:00:19,000 --> 00:00:22,000a cousin of mine took me on a tour of his medical school.300:00:22,000 --> 00:00:24,000And as a special treat400:00:24,000 --> 00:00:2 关于perl的问题 100:00:09,855 --> 00:00:14,724Britain was an object of desire.200:00:26,295 --> 00:00:31,847Tacitus declared it worth the conquest,300:00:32,015 --> 00:00:35,803the best complimentthat could occur to a Roman.如果以句号为分 关于perl的问题 100:00:09,855 --> 00:00:14,724Britain was an object of desire.200:00:26,295 --> 00:00:31,847Tacitus declared it worth the conquest,300:00:32,015 --> 00:00:35,803the best complimentthat could occur to a Roman.如果以句号为分 如何用Perl读取文件并分情况统计满足条件的个数的百分比请问如何写一个Perl脚本,使之可以实现以下功能:用ARGV[0]读入一个有若干行的文件,首先一行行读取判断其是否有元素“a”,如果有“ Perl编程问题,怎样替换对应的数字或者字符串?我有两个文件1.txt和2.txt.在1.txt中,有2列,第一列是元素名字,第二列是它对应的数字,但是有几百行.格式如下:a(3)xvsd 1bfsoek 2arg 3tya 4.等等在2.txt中 看到你的百度知道,有个问题希望能帮我一把,写一段perl.在文件中的提取名称:.在这样的文件中,把“ABC”前面的名称“123”和“234”提取到一个新文件中,“345”不用提取到新文件中. 如何用perl读入一个文件,计算文件中各个单词的出现频率,再输出用perl读入一个文件shizegengo.txt,计算文件中各个单词的出现频率,然后再按左边-单词,右边-出现次数perl -w# frequency%count;open TERM, perl $@ Shell或者perl进行随机分组的问题我想对1个文件进行随机分组,也就是文件的第2列分成2个数,第3列也分成2个数,但是分配到的数是在原来准备分配的那个数的2/5~3/5范围内比如我的文件像下面这 mapgis中现有的线文件怎样转成区文件 perl 字符数字混合的匹配我有A文件:B文件:chr1 ABC chr19 abc chr2 EDF chrX ab67chr3 345chr4 AB67然后我想找出A的第二列和B的第二列相同的,就是假如$a[1]和$b[1]相同的话(不区分大小写),就输出$a[0] $a[ 请教一个perl基础问题,for $ranking (reverse sort keys %node),这句的含义是什么 大家谁知道怎样用perl解决生物问题 perl中reverse用法问题在perl中 reverse遇到/bin/perl@arr = qw / a b c d/;chomp( @arr );@arr = reverse ( @arr );print @arr;上面能正确翻转数组 打印出 dcba如果我这样写:/bin/perl -w#print 输入字符串(ctrl+d结束): ;@arr 我写perl的,表示或者关系写法有一个问题 a==1||a==2||a==3||a==4可以写成类似a==(1||2||3||4)吗?怎么写 perl分析基因序列就是给出一个.fa类型的文件,找出其中的N长度,GC长度,GC比例等信息. 求一段perl分割fasta中DNA序列的代码 fasta文件中有数千条DNA序列,都是按照注释,求一段perl分割fasta中DNA序列的代码fasta文件中有数千条DNA序列,都是按照注释,序列,注释,序列放置,分割后,在指定目 中央发了多少个关于农业问题的一号文件