Home | Links | Weblog

Friday, December 29, 2000
Opened the Washington Post today and found my letter to the editor on the Editorial page. It was my small way of voicing my outrage over the number of pedestrian deaths in the past several months in the DC area, over 10 in December alone. And most police quoted in the papers or on TV blame the pedestrians for not walking in crosswalks, never about drivers speeding or running red lights, which happens constantly around here.

Updated the Hunter Mill District web site that I created and maintain. Unfortunately it only takes a couple of hours a week, so I don't work as many hours as I would like.

Spent about an hour yesterday writing a short Perl program to convert my Netscape addresses to a format that can be entered into my Sharp TM-20 Pocketmail device. It should have taken about 15 minutes; it's a real short program that doesn't do much. I'd rather spend the hour messing with a program than typing in the addresses.

# Program to read addresses exported from Netscape as comma-delimited file and reformat for input to
# Pocketmail address entry application.
# Bruce Wright, 12/28/00
if ($ARGV[0] eq '' || $ARGV[1] eq '') {
die "Usage: ns2pocket.pl infile outfile\n";
$infile = $ARGV[0];
open (IN,$infile) || die "can't open $infile: $!"; # $! is error string var
$outfile = $ARGV[1];
open (OUT,">$outfile") || die "can't open $outfile: $!";
$i = 0;
print OUT "Sharp TM-20 Data V1.0\nA\n";
print OUT "\"Index\",\"Visible\",\"Last Name\",\"First Name\",\"Company\",\"Position\", "Home#\",\"Office#\",\"E-mail 1\",\"E-mail 2\",\"E-mail 3\",\"Fax#\",\"Address\",\"City\",\"State\",\"Zip code\",\"Country\",\"Note\"\n";
while () {
# remove end of line with chop
chop $_;
# split out variables using tab (\t)
$fax,$home,$org,$nickname,$cell,$pager) = split(/\t/,$_);
print OUT ++$i,",1,\"$lastname\",\"$firstname\",\"$org\",\"$title\",\"$home\",\"$work\",\"$email\",\"\"\,\"\",\"
close(IN) || die "can't close $infile: $!";
close(OUT) || die "can't close $outfile: $!";

Comments: Post a Comment