Friends,
i have two huge complex files (for eg :A & B)as output ,
the sample contents of the files are as follows :
A
ID,DATE,SUM1,SUM2,TOTAL(SUM1+2)
A5066,20/04/2010,25000,50000,75000
A5049,20/04/2010,25000,60000,85000
B
ID,DATE,SUM1,SUM2,TOTAL(SUM1+2)
A5066,21/04/2010,25000,70000,95000
A5049,21/04/2010,25000,20000,45000
The above files are generated on daily basis and the problem is the printed date is calendar date.
I would like to compare the files A&B and print file C as follows :
File C :
ID,DATE,SUM1,SUM2,TOTAL(SUM1+2)
A5066,21/04/2010,25000,70000,95000
A5049,20/04/2010,25000,20000,45000
The condition is :
The date in the new file should be printed from the file (A) if the total(Column 5) in File B is less than File A
To be honest,i am confused of what command to use...I was nibbling with awk ..but couldn't go anywhere.It will be great if any suggestions or ideas can be provided.
Thanks in advance.