diff --git a/Utils/pick-convertor.pl b/Utils/pick-convertor.pl new file mode 100644 index 00000000000..a29e3d98d81 --- /dev/null +++ b/Utils/pick-convertor.pl @@ -0,0 +1,78 @@ +#!/usr/bin/perl -w + +use Switch; +use strict; + +my $source = "zendikar-pick.htm"; +my $destination = "result.txt"; + +open SRC, "< $source" or die "Can't open source: $!\n"; +open DST, "> $destination" or die "Can't open destination: $!\n"; + +my $state = 0; + +my $name; +my $rate; +my $max; +my $med; +my $min; + +while () { + my $s = $_; + chomp $s; + if ($state == 0) { + if ($s eq "") { + $state = 1; + next; + } + } elsif ($state == 1) { + if ($s =~//) { + $state = 2; + next; + } + } elsif ($state == 2) { + if ($s =~/>([\w ',]+)<\/a>/) { + $name = $1; + $state = 3; + next; + } + } elsif ($state == 3) { + if ($s =~/