1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-13 23:36:08 +00:00
freebsd-ports/japanese/zipcodes/scripts/gennew.pl
Jun-ichiro itojun Hagino ad0eaa14c6 japanese zipcode tables. includes both 3/5 digits form and 7 digits form.
just like /usr/share/misc/zipcodes.
1997-11-12 05:12:18 +00:00

17 lines
418 B
Raku

while (<>) {
s/"//g;
split(/,/, $_);
$_[2] =~ s/[ \t]//g;
$_[8] = '' if ($_[8] eq '');
$zipstr = $_[6] . ' ' . $_[7] . ' ' . $_[8]; # uniq
$zipstr =~ s/[ \t]+$//;
$zip{$zipstr} = $_[2];
}
print "# Zip code:location\n";
print "# 7 digits zipcode for japan, used since feb98.\n";
foreach $i (sort {$zip{$a} cmp $zip{$b}} keys %zip) {
next if ($i eq '');
print $zip{$i} . ':' . $i . "\n";
}