diff options
Diffstat (limited to 'fahrplan.rkt')
-rwxr-xr-x | fahrplan.rkt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fahrplan.rkt b/fahrplan.rkt index 07f2b08..7428e90 100755 --- a/fahrplan.rkt +++ b/fahrplan.rkt @@ -1,9 +1,9 @@ #!/usr/bin/env racket #lang racket/base -(define input-file "fahrplan-2022.csv") +(define input-file "fahrplan.csv") (define gtfs-prefix "gtfs-template/") -(define out-prefix "gtfs/") +(define out-prefix "gtfs-generated/") (require racket/string @@ -103,13 +103,15 @@ (lambda (chunk) (let ((number (fp-cell (car chunk) col))) ; does this column contain a train number? - (if (equal? "" number) + (if (or (equal? "" number) (equal? "Fahrt" number)) #f ; extract all lines that look like they contain stations `(,number ,(filter-map (lambda (line) - (if (station? (list-ref stations line)) + (if (and (station? (list-ref stations line)) + ; not all lines serve all stations + (not (equal? (list-ref (list-ref planfahr col) line) "-"))) `(,(list-ref stations line) ,(list-ref (list-ref planfahr col) line)) #f)) |