opnsense-ports/japanese/zipcodes/scripts/genold.pl
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01:00

16 lines
423 B
Raku

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