diff --git a/Utils/pick-convertor.pl b/Utils/pick-convertor.pl index a29e3d98d8..89a135ae75 100644 --- a/Utils/pick-convertor.pl +++ b/Utils/pick-convertor.pl @@ -3,8 +3,13 @@ use Switch; use strict; -my $source = "zendikar-pick.htm"; -my $destination = "result.txt"; +print "Enter a set name: "; +my $set = ; +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 DST, "> $destination" or die "Can't open destination: $!\n"; @@ -17,6 +22,7 @@ my $max; my $med; my $min; + while () { my $s = $_; chomp $s; @@ -72,7 +78,9 @@ while () { $state = 11; } } elsif ($state == 11) { - print "$name|$rate|$med\n"; + print DST "$set|$name|$rate|$med\n"; $state = 1; } -} \ No newline at end of file +} + +close DST; \ No newline at end of file