I wonder how the below lines compare the 1st column and put the correspond value ?
awk 'NR==FNR{v[$1]=$4;next}{print $0,v[$1]}' countNeigbor.txt countSR.txt
MR. PHV (MIS,
I am so much glad to try your code. Its only one line code. and it works
Its what I wanted.
Sorry, did not tried it before.
I thank you a lot to help me. Have a good day !
Thanks you so much again for everyone.
I got the result as I wanted. Just needed to change the column in the code provided.
{k=""; for(i in f1){if(i==$3)k=f1[i];} print $0" "k;}' file2
It works.
Thanks you so much.
Please keep helping with a smile!
Thank you so much for your support and quick responses.
It helps me,Thanks a lot LKBrwnDBA.
But I did not get the result file as I wanted. The values that are mapped are not the values that correponds to 1st column.
I explain it again.
1) File countNeighbor.txt (file-1) and it is sorted...
Hi :),
I have two files.
file-1 named "countNeigbor.txt" have 4 columns, --- column 1 has its corresponding value in column 4
file-2 names "countSR.txt", have 3 columns, ----- column 1 values == column 1 values of file-1 but it repeates .
file-2 : column 1 has its correspondance reference with...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.