User Tools

Site Tools


ic:perl-script
Schedule extractor

This is the Perl-script that generates the schedule. Hopefully, this will avoid mistakes as the one of 20 September!

#!/usr/bin/perl -w
# zet schema van Totelos om in een tabel voor Dokuwiki
                                                            #
@days = ("Tue", "Tue", "Thu", "Thu"); # dit is afschuwelijk en kwetsbaar
$day_id = 0;
                                                            #
while (<>) {
  chop;
  s/Old Soccers D/Old Soccers/g;
  ($date, $time, $hall, $team1, $x, $x, $team2, $linesman) = split( / *\t */);
  if ( !$date ) { $date = $prevdate; }else{ $prevdate = $date; }
  if ( !$hall ) { $hall = $prevhall; }else{ $prevhall = $hall; }
  
  $day = $days[$day_id++];
  $match = $team1.$team2;
  if ($match =~ /Old Soccers/i) {
      print "|$day | $date | $time |  hal $hall  |$team1 - $team2  | | |\n";
  } elsif ($linesman =~ /Old Soccers/i) {
      print "|$day | $date | $time |  hal $hall  |**Linesman:** | \n";
  }
  $day_id %= @days;
}
  
ic/perl-script.txt · Last modified: 2013/05/02 12:49 (external edit)