Hi,
I have the below flat filewith ~ as delimiter
emp.no~dept.name
I need to append corresponding emp.name column which will come from database based on emp.no in the flat file.
I need the output as
dept.name~emp.name
Can anyone please help me in resolving this issue..
I tried the below code..
cat input_file | gawk -f awk_file > outputfile
awk file will be:
BEGIN
{
print $0 "~" emp.name
while IFS="~" read f1 f2
do
emp.name=` db2 "select emp.name from table where emp.id=$f1
cut -d'~' -f1 input_file
done < input_file
}
Thanks in advance