Update of /cvsroot/linux-atm/linux-atm/src/lib
In directory usw-pr-cvs1:/tmp/cvs-serv24317/src/lib
Added Files:
Tag: V2_4_0
pdf2e164_cc.pl
Log Message:
This script converts the PDF version of the E.164 Country Code document for
the ATM Naming Service (ANS) en leu of the old RTF conversion script.
--- NEW FILE: pdf2e164_cc.pl ---
#!/usr/bin/perl
#
# The E.164 country code listing "List of ITU-T Recommendation E.164 Assigned
# Country Codes" can be obtained from
# The International Telecommunications Union (ITU) http://www.itu.org/
# at http://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_717.html
#
# Usage of this program:
# perl pdf2e164_cc.pl e164_xxx.pdf >/etc/e164_cc
#
open(PDF2TXT, "pdftotext -raw $ARGV[0] - |");
while(<PDF2TXT>) {
next unless /^(\d+)\s+(.+)\s+/;
last if $1 == 999;
}
while(<PDF2TXT>) {
next unless /^(\d+)\s+(.+)\s+/;
($country, $junk) = split(/\s{2,}/, $2, 2);
printf("%-3d %s\n", $1, $country) || die "printf: $!";
last if $1 == 999;
}
close(PDF2TXT);
|