01-26-2007
134,
2
Join Date: Feb 2006
Last Activity: 3 February 2012, 11:19 PM EST
Location: Schenectady, NY
Posts: 134
Thanks Given: 0
Thanked 2 Times in 2 Posts
Glenn's solution is much nicer than mine (I got stuck in sed mode) but I present it anyway:
for FILE in *
do
sed -e = $FILE | sed -e N -e "s/\([0-9]*\)\(.\)\([^ \t]*\).*$/delete from \3;\2.IF ERRORCODE <> 0 Then .QUIT \1/"
done
There is no right or wrong -- it's UNIX -- there's just style.
Last edited by hegemaro; 01-26-2007 at 01:13 PM..
Reason: cleaner code and checks for either tab or space per anbu23