Hello all,
I am a newbie in awk. I am struggling in this problem for a long.Actually I have two files, filea and fileb. File a is actually a search key through it I have to find the corresponding japanese tag from file b.
filea contains the data like this:
sm982882 sm1893548
sm2420025 sm2420128
sm2420025 sm1654558
sm1715919 sm3504435
sm1050729 sm1049371
sm1200230 sm1783839
and fileb contains the data like this:
147 sm1864839;sm1878115;sm1950540;sm2106734;sm2178096;sm2183582;sm2415525;sm982882;sm2512481;sm2554063;sm2652509;sm1893548;sm2723097;sm2785830;sm2898082;
513 sm479;sm36902;sm41429;sm43160;sm68724;sm72831;sm1654558;sm153858;sm155799;sm157569;sm162299;sm168973;sm171423;sm174780;sm176263;sm181722;sm185763;sm210482;sm215266;sm218312;sm224020;sm232251;
The result of output should be the like this:
sm982882 sm1893548
I use the following way but it does not produce any result:
awk ' {col1=$1; col2=$2;} END{if($3~/col1/&&/col2/) print $1 col1,col2;}' filea fileb
.
Any help in this will be highly appreciable.
Best,
Mohan:wall: