its very much clear and I have tested and its working fine for my small input files.
Really thankful to you for all your support.
But while testing same logic for bigger input files. I saw some strange behaviour.
like
whereas "712345692,820017123456132,7123456921" exists in both file8 and file9. So result should not be NA.
in file8 its in line 1792131 and in file9 its at 1st line.
what could be the reason of this NA now since data is at coloumn 3 but at row 1792131.
anything can improve in code that it include lines upto 3000000 search for vlookup of column 3.
---------- Post updated at 10:33 PM ---------- Previous update was at 04:28 PM ----------
Quote:
Originally Posted by shanul karim
its very much clear and I have tested and its working fine for my small input files.
Really thankful to you for all your support.
But while testing same logic for bigger input files. I saw some strange behaviour.
like
whereas "75123456,820012345601132,712345921" exists in both file8 and file9. So result should not be NA.
in file8 its in line 1792131 and in file9 its at 1st line.
what could be the reason of this NA now since data is at coloumn 3 but at row 1792131.
anything can improve in code that it include lines upto 3000000 search for vlookup of column 3.
Finally it's solved..Thanks again for support. Actually it's resolved by copy content of input files in text format manually using ultra edit. And then apply your awk command.
I would like to merge data from a reference file and a data file to produce a new output file as shown below.
Reference file,data file,output file
a , b 2 , a 0
b , d 4 , b 2
c , , c 0
d , , d 4
e, , e 0 (3 Replies)
hi frnds
i have 2 files. 1st is dddd and 2nd is ssss
==> dddd <==:
1,charit
2,gilhotra
==> ssss <==:
1,sajan
2,doda
3,hello
and i want o/p ...mean join and vlookup both files
sajan,charit (4 Replies)
Hello,
I am trying to use vlookup (Excel function) using awk but there is some problem :(
--file1--
ABC123
101F
X1 A $P=Z
X2 A $P=X
X3 B $P=F
X4 C $P=G
MNK180
END
--file2--
X1 A_t $P=Z
X2 A_t $P=X
X3 B_u $P=F
X4 C_o $P=G (2 Replies)
I am developing shell script on Linux OS and I have two files.Data in each file is like :
File1 :
A B C
E F G
X Y Z
File 2:
A C 12
E G 22
X Z 41
I need if first and third column entries ( $1 & $3) of File1 in same row matches with first & second column... (3 Replies)
Hi folks,
awk 'NR==FNR {m=$0; next} $1 in m{$0=m} {print}' file2 file1
Works a charm for a vlookup type query, sourced from https://www.unix.com/shell-programming-and-scripting/215998-vlookup-using-awk.html
However my column content has white spaces and numbers. Example
file1
The Man... (6 Replies)
Hi everyone,
I need to replace values of column 2 array1 with values of column 2 array2 based on a lookup of column 4 value, but only return a value IF the values in column 1 of BOTH array1 and array2 match, otherwise keep original value in column 2 of array1. Both files are tab delimited... (2 Replies)
Hello, i am trying to print group name column(etc/group) on script (etc/passwd) since group name is not listed on etc/passwd columns. Im trying to do a vlookup. but i cant figure out how i can insert the vlookup command FNR==NR inside the print out command or the output. I also tried exporting... (2 Replies)
Hi I just want again to ask for help on what command to use to vlookup f1 group name in "/etc/group" matching f3 of it to "/etc/passwd" f4. I do need to display group name in the output of /etc/passwd without using awk or NR==FNR command. thank you
while
IFS=: read -r f1 f2 f3 f4 f5 f6 f7... (4 Replies)