KShell
Hi guys I need a format or an approach to this problem i am facing to combine 2 log and generate a new result.. help is very much appreciated..
i have 100 of records in textfile 1 and 77 records in textfile 2. So I pretty much need to start with loops =(
#remove header and footer
sed '1,16 d' </tmp/$resultEqpt_dir >/tmp/$resultEqpt_dir.out
sed '111,116 d' </tmp/$resultEqpt_dir.out >/tmp/$resultEqpt.log
#Housekeeping: Delete the result temp file
rm /tmp/$resultEqpt_dir.out
rm /tmp/$resultEqpt_dir
#Execute the second SQL query
$cur_dir/select-eqptDeployment-bt-status > /tmp/$resultEqptstatus_dir
#remove header and footer
sed '1,16 d' </tmp/$resultEqptstatus_dir >/tmp/$resultEqptstatus_dir.out
sed '88,93 d' </tmp/$resultEqptstatus_dir.out >/tmp/$resultEqptstatus.log
#Housekeeping: Delete the result temp file
rm /tmp/$resultEqptstatus_dir.out
rm /tmp/$resultEqptstatus_dir
awk -F, 'FNR==NR{a[$1]=$2;next}{$(NF+1)=($1 in a)?a[$1]:"UNDEPLOYED"}1' OFS, /tmp/$resultEqpt.log /tmp/$resultEqptstatus.log
I gt my error:
awk: syntax error near line 1
awk: illegal statement near line 1
awk: syntax error near line 1
awk: bailing out near line 1
---------- Post updated 09-21-12 at 10:51 AM ---------- Previous update was 09-20-12 at 06:22 PM ----------
i m looking for the solution that is if txtfile 1 have the record file found in txtfile 2.
new > result file will have txtfile1 with line + 'DEPLOYED'
else if record file is not found in txtfile 2 +'UNDEPLOYED'
---------- Post updated at 11:32 AM ---------- Previous update was at 10:51 AM ----------