5

Match columns and fetch whatever in front of it

view full story
linux-howto

http://www.unix.com – Hi Solved these kind of issues using these codes But these are not wrking for my attached files can anybody check........ Code: awk 'NR==FNR{X[$1]++;next}{if(X[$1]){print}}' file1 file2 Code: awk 'NR==FNR{X[$1]=$0;next}{n=split($1,P," ");sub($1,"",$0);for(i=1;i<=n;i++){if(X[P[i]]){print P[i],$0}}}' file1 FS="\t" file2 Please let me know any changes for my attached files. I have to find common entries of first columns in bioth files if matches then fetch whatever in front of it in second file. first file is BDc second file is BD use Kindly check (HowTos)