User Tools

Site Tools


ic:schedule_extractor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ic:schedule_extractor [2013/05/02 12:49] (current)
Line 1: Line 1:
 +==== Schedule Extractor Script ====
 +
 +  #​!/​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/schedule_extractor.txt ยท Last modified: 2013/05/02 12:49 (external edit)