#!/bin/sh

LIST=`ls *.html`

for i in $LIST ;
do

j=`echo $i | cut -d"." -f 1`
echo -n "$i --> $j.pre"
html2text -width 240 -nobs $i | sed -e "/sq km/s//km/g" \
                   | sed -e "/cu m/s//m/g" \
		   | sed -e "/Rank[:space]Order/s//Rank_Order/g" > $j.pre
echo " --> $j.txt"	   
./reformat -f $j.pre -y $1
rm -f $j.pre

done
