I have list of two kind of files and I want to compare the rows and print the merged data by applying if condition.
First kind of file looks like:
and second kind of file looks like :
I want to print the rows present in second file followed by 3 more columns from first file by applying if condition
if (3rd column = 1st column - 1) #from second file
compare it in first file and
print 3rd, 4th and 5th column from the row having (column1 in frist file=
column1 in second file && 3rd column = 1st column +1 ) # in first file
and vive versa....
i.e, if (3rd column = 1st column + 1)
then print 3rd, 4th and 5th column from the row having (column1 in first file= column1 in second file && 3rd column = 1st column - 1 ) # in first file
@ Bartus: yes, the answer indicated by u is correct....but, m sorry to say that I am not getting any output from ur help code and also I want to undersatnd ur code...can u please explain it to me and assist me to get the correct output
M really very sorry for the above said....as ur code is working on other similar files....and the output is exactly similar to what I needed....Thanks a lot
my previous sample data file has some faults in column number....