Search Results

Search: Posts Made By: satece
2,878
Posted By satece
Hi Akshay, Scrutinizer, I created the files...
Hi Akshay, Scrutinizer,

I created the files again. It is working fine for the both awk statements. Thanks for the help. Do we need to have same number of records in both the files to use this...
2,878
Posted By satece
Hi Akshay, Checked the code you posted,...
Hi Akshay,

Checked the code you posted, Surprisingly it is giving out the 3 rows as output. I am not sure how awk exactly works. Please suggest.
2,878
Posted By satece
Hi Akshay, Thanks for the quick help. But...
Hi Akshay,

Thanks for the quick help. But facing the same problem.
Getting the output as:
a1,b1,1
a2,b2,2
a3,b4,3

Please suggest.
2,878
Posted By satece
Hi, Similar to the above post, we are...
Hi,

Similar to the above post, we are filtering the lines based on the 2 columns.

Input file1

a1,b1,1
a2,b2,2
a3,b4,3
a4,b3,4

Input file2
5,a1,b1
6,a2,b2
7,a3,b3
8,a4,b4
...
2,878
Posted By satece
Hi Scrutinizer, awk -F, 'NR==FNR{A[$1]=$3;...
Hi Scrutinizer,
awk -F, 'NR==FNR{A[$1]=$3; next} $1 in A{$1=A[$1]; print}' FS=, OFS=, file2 file1
is working perfectly. Can you please explain the command and its working?

Thanks,
satece
2,878
Posted By satece
Comparing two files in UNIX and create a new file similar to equi join
I have 2 files namely branch.txt file & RXD.txt file as below

Ex:Branch.txt
=========================
B1,Branchname1,city,country
B2,Branchname2,city,country
...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 03:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy