04-28-2009
42,
1
Join Date: Sep 2008
Last Activity: 6 June 2018, 1:12 AM EDT
Posts: 42
Thanks Given: 3
Thanked 1 Time in 1 Post
matching file and redirecting
Hi all
I have two file a.txt and b.txt and i want to compare their first coloum and print the o/p to the third file c.txt
comparing should be in such a way that if matching first coloum is not found in any of the file then it should print No row
like here AAA is present in both file so o/p file have all coloums value but BBB is not in 2n file so in o/p file 4th and the
coloum have No row entry
I am using join for matching but it prints only coloum which is in both the file
so pls help me in this
a.txt
AAA,23,34
BBB,45,67
CCC,21,33
DDD,56,78
b.txt
CCC,88,91
AAA,26,78
EEE,61,11
matching should be based on first coloum of both the file
1st coloum ,2n coloum of fisrt file,3 coloum of fist file,2n coloum of second file,3 coloum of 2n file
and if no matching coloum is found then it should be "No row"
AAA , 23 , 34 ,26 ,78
BBB , 45 , 67 ,NO row ,No row
CCC , 21 , 33 ,88 ,91
EEE , NO row , NO row ,61 ,11
DDD , 56 , 78 ,No row ,No row
pls provide me solution as it is very urgent for me
Last edited by aaysa123; 04-29-2009 at 10:37 AM..