3 $PLAYER_DATA_PATH = "/home/mlong/mamer/players";
4 $OUTFILE = "/home/mlong/mamer/data/rank.new";
6 # you should not have to change this its just where it belongs
7 @dirList = ("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
8 "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "_");
13 foreach $a (@dirList) {
14 if(-d "$PLAYER_DATA_PATH/$a") {
15 # printf("$PLAYER_DATA_PATH/$a\n");
16 opendir(THISDIR, "$PLAYER_DATA_PATH/$a");
17 @tempdir = sort(readdir(THISDIR));
20 foreach $file (@tempdir) {
21 if(!(-d "$PLAYER_DATA_PATH/$a/$file")) {
22 # printf ("Converting %s %s\n", $file, $PLAYER_DATA_PATH);
23 open(IN, "$PLAYER_DATA_PATH/$a/$file") || die "Can't open $file\n";
26 ($n, $abuse, $tourneys, $w, $l, $d, $fsts, $scds, $thds, $rating,
27 $placePoints, $managerLevel, $managedTourneys, $last, $tourneyLocation) = split(/ /, $line);
29 $rank{$n} = "$rating $n $tourneys";
39 foreach $a (reverse (sort (values %rank))) {
40 ($b, $c, $d) = split(/ /, $a);
45 open(OUT, ">>$OUTFILE") || die "Can't open $OUTFILE\n";
46 printf OUT ("%-18s %d %4.2f\n", $c, $d, $b);