![]() |
|< 1 2 >| | ![]() |
13 Einträge, 2 Seiten |
[E|B,05.01.2006, 22:40]Zeile 19 sollte so lauten:
Code: (dl )open(my $fh, "> $file") or die $!;
renee hat vergessen die Datei zum Schreiben zu öffnen.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl
use strict;
use warnings;
use Tie::File;
my $file = 'BlastOutput.txt';
my %hash;
my @sorted;
my $i = 1;
tie my @array,'Tie::File',$file or die $!;
chomp @array;
while($i < scalar(@array)-1){
push(@{$hash{$array[$i]}},$array[$i+1]);
push(@sorted,$array[$i]) unless(grep{$_ eq $array[$i]}@sorted);
$i += 2;
}
untie @array;
open(my $fh,">$file") or die $!;
for my $key(@sorted){
print $fh $key,"\n",join("\n",@{$hash{$key}}),"\n";
}
close $fh;
push(@{$hash{$array[$i]}},$array[$i+1]);
1
2
3
4
ref|XP_709868.1|-->PREDICTED: similar to topoisomerase I beta isoform 5 [Danio rerio]
ref|XP_709866.1|-->PREDICTED: similar to topoisomerase I beta isoform 3 [Danio rerio]
ref|XP_709869.1|-->PREDICTED: similar to topoisomerase I beta isoform 6 [Danio rerio]
ref|XP_709865.1|-->PREDICTED: similar to topoisomerase I beta isoform 2 [Danio rerio]
![]() |
|< 1 2 >| | ![]() |
13 Einträge, 2 Seiten |