Thread empty Files (9 answers)
Opened by paidopoieo at 2005-12-07 03:12

paidopoieo
 2005-12-07 03:12
#60736 #60736
User since
2005-12-02
96 Artikel
BenutzerIn
[default_avatar]
Hi,
Ich habe folgendes kleines Problem, ich will ein File parsen, und die Resultate in ein anderes rausschreiben....ich weiss nichts aussergewoehnliches.....
trotzdem waere eure Hilfe nett... ;)

Code: (dl )
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/perl -w

my @raw_data;
my $wrestler;
my @work_array;

print "Starting Program......Hopefully.....\n";

open (bigShot, "BigOne.txt") || die ("Could not open file. $!");
print "File bigShot openend successfully \n";

@raw_data = <bigShot>;
print "stored entire file in Array \n";
close (bigShot);
print "closed file bigShot \n";

print "trying to enter foreach....\n";
foreach $wrestler (@raw_data) {
print "entered foreach successfully \n";


print $wrestler, "\n";
#@work_array = $wrestler;
print "trying to enter if Condition....\n";
if ($wrestler =~ m/^>sp/ || $wrestler =~ m/^Query/ || $wrestler =~ m/^Sbjct/) {
print "if condition entered successfully\n";



open (cuttedFile, ">cuttedFile.txt") || die ("Could not open file. $!");

print "File cuttedFile opend successfully \n";

print $wrestler;

close (cuttedFile);
}
}
print "finished foreach \n";




Dankeschoen im Voraus

mfg
Hubert

View full thread empty Files