Enchanced pick-order script.

This commit is contained in:
magenoxx 2011-02-08 11:42:28 +03:00
parent f377eee8e0
commit 28a74c68b1

View file

@ -3,8 +3,13 @@
use Switch; use Switch;
use strict; use strict;
my $source = "zendikar-pick.htm"; print "Enter a set name: ";
my $destination = "result.txt"; my $set = <STDIN>;
chomp $set;
my $lset = lc($set);
my $source = "$lset.htm";
my $destination = "$lset.txt";
open SRC, "< $source" or die "Can't open source: $!\n"; open SRC, "< $source" or die "Can't open source: $!\n";
open DST, "> $destination" or die "Can't open destination: $!\n"; open DST, "> $destination" or die "Can't open destination: $!\n";
@ -17,6 +22,7 @@ my $max;
my $med; my $med;
my $min; my $min;
while (<SRC>) { while (<SRC>) {
my $s = $_; my $s = $_;
chomp $s; chomp $s;
@ -72,7 +78,9 @@ while (<SRC>) {
$state = 11; $state = 11;
} }
} elsif ($state == 11) { } elsif ($state == 11) {
print "$name|$rate|$med\n"; print DST "$set|$name|$rate|$med\n";
$state = 1; $state = 1;
} }
} }
close DST;