- 论坛徽章:
- 0
|
本帖最后由 raoweijian 于 2013-06-04 11:30 编辑
回复 15# sinian126 - #!usr/bin/perl -w
- use strict;
- my $if = shift;
- open IF,"<$if";
- open INFO,"<message.info";
- open OF,">$if.scaffold";
- my $tell = 0;
- while(<IF>){
- next if (/^#/);
- chomp;
- my @t = split;
- seek(INFO,$tell,0);
- while(<INFO>){
- chomp;
- my @c = split;
- # my $c = @c;print "$c\n";
- next if(!defined($c[7]));
- if(($c[1] <= $t[1]) && ($c[2] >= $t[1])){
- $t[0] = $c[4];
- $t[1] = $t[1] - $c[1] + $c[5];
- for my $i (0..8){
- print OF "$t[$i]\t";
- }
- print OF "$t[9]\n";
- $tell = tell(INFO) - 1000;
- last;
- }
- }
- }
复制代码 |
|