#!/bin/csh

set noclobber

foreach i ( *.txt )
    set idx=`basename $i .txt`.idx
    grep -n '^Subject:' $i | sed -e 's/:/	/' | expand >$idx
end
