#!/usr/bin/perl
my $in = $ARGV[0];
die "NO INPUT!\n" if(!defined($in));
open RH ,$in or die "Cannot open $in:$!";
my @lines = ; chomp @lines;
close RH or die "$!";
open WH,">$in" or die "$!";
print WH $lines[0],"\n\n\n";
my @fields = split(/\s+/,$lines[3]);
$fields[0] =~ /(\d+)-(\d+)/;
my $len = $2 - $1 + 1;
for(my $i = 3; $i < @lines - 1; $i ++){
@fields = split(/\s+/,$lines[$i]);
print WH "$fields[0]\t\t";
print WH substr($fields[1] ,0,$len),"\n";
}
close WH or die "$!";
阅读(1083) | 评论(0) | 转发(0) |