#!/usr/local/bin/perl
#
#
# Keio Line Time Table Converter
# Version 1.2
# Copyritht (c) 1999 IWAMA Naozumi
#
# This script was written in SJIS originaly and
# tested on jperl version 4 (WIN32.Pentium, SJIS).
# You may run on perl 5 in EUC.
#
# This software is absolutely no warranty!
$tablel = 0; # Nesting level of table.
$tablel1c = 0; # Counter of nesting level 1 table
# The time table is the second one.
$titlef = 0; # Flag for
$trf = 0; # Flag for
$tdf = 0; # Flag for
$bf = 0; # Flag for
$commentf = 0; # Flag for
$commentf = 0;
} elsif (s/^\s*([^\<]*)\\) {
# Text with '<'
if ($titlef == 1) {
# foo
print $1;
$title = $a = $1;
# Check info.
if ($a =~ (/井の頭/)) {
$inokashiraf = 1;
}
if ($a =~ (/休日/)) {
$sunholf = 1;
}
if ($a =~ (/土/)) {
$satf = 1;
}
} elsif ($tablel1c == 2) {
# The time table is the second one.
if ($bf == 1) {
# Print an hour element of the time table
print "\n" . $1 . ": ";
} else {
# Print a minute element of the time table
$sym = $1;
&transsym;
print $sym;
}
}
} else {
(s/(^.*)//);
# Print the rest of line (which contains no tag)
if (($tablel1c == 2) && ($tdf > 0) && ($commentf == 0)) {
# Print minute element of the time table
$sym = $1;
&transsym;
print $sym;
} else {
# Other comment
if ($commentf == 0) {
print "\n" . ";" . $& . "\n";
}
}
}
}
}
|