hi
the sample of input file is :
Quote:
ACCOUNT_MISSING-4 ACCOUNT_MISSING- is missing
ADP_COMMENT-2311 ADP_COMMENT- 2384
ADP_CONFIG-11 ADP_CONFIG- 11
ADP_FIELD-36323 ADP_FIELD- 36333
|
I need to cut each field and store in varibles.
example: tablename1= ACCOUNT_MISSING
count1=4
tablename2= ACCOUNT_MISSING
count1=is missing
what I have tried is:
Quote:
#!/bin/ksh
paste -d ' \ ' logcountOP DBcountOP400 > differencenewOP
export file="differencenewOP"
while read FILE_LINE ; do
LINE1="$(echo $FILE_LINE | cut -d ' ' -f1)"
tablename1="$(echo $LINE1 | cut -d '-' -f1)"
echo tablename1 is $tablename1
count1="$(echo $FILE_LINE | cut -d '-' -f2)"
echo count1 is $count1
LINE2="$(echo $FILE_LINE | cut -d ' ' -f3)"
tablename2="$(echo $LINE2 | cut -d '-' -f1)"
count2="$(echo $LINE2 | cut -d ' ' -f2)"
echo tablename2 is $tablename2
echo count2 is $count2
if [ $count1 = "is" ]
then
echo missing
echo status for $tablename1- does not exist in DB >> statusOP
elif [ $count1 -eq $count2 ]
then
#echo match
echo status for $tablename2 $count2 $count1- match >> statusOP
elif [ $count1 -ne $count2 ]
then
#echo mismatch
echo status for $tablename2 $count2 $count1- mismatch >> statusOP
fi
done < $file
|
please help