I have a data file with fixed length records starting with an ID number. I have another file with a list of ID numbers and names. I'm comparing the data file to the list file and removing any record in the data file that doesn't have a match in the list file. When I do this, the READ comand is removing the white space and in effect destroying the fixed length records. Any suggestions how to fix this?
MY SCRIPT:
while read LINE
do
grep "`echo "${LINE}" | cut -f${1} -d ' '`" ${3} > /dev/null
if [ $? -eq 0 ]; then
echo "found some good stuff"
echo $LINE >> goodstuff
else
echo $LINE >> badstuff
fi
printf "%s" $LINE
done
Any suggestions? Please Help!
Tony You can usually find me at
MY SCRIPT:
while read LINE
do
grep "`echo "${LINE}" | cut -f${1} -d ' '`" ${3} > /dev/null
if [ $? -eq 0 ]; then
echo "found some good stuff"
echo $LINE >> goodstuff
else
echo $LINE >> badstuff
fi
printf "%s" $LINE
done
Any suggestions? Please Help!
Tony You can usually find me at