#!/bin/sh

CITY=$1
[ -z "$1" ] && {
	echo "Usage: $0 city"
	exit
}

i=0
(cat $CITY/* | grep "<TD NOWRAP>" | sed -e "s|</.*||;s|<.*>||" | \
while read line
do
	[ $i = "3" ] && {
		i=0
		echo
	}
	echo -n "$line;"
	i=$(($i+1))
done) | sort | uniq > ${CITY}_phones_`date +%Y%m%d`.txt
