Search Results

Search: Posts Made By: shaan4uster
9
7,031
Posted By shaan4uster
Thanks a lot
It is working as expected.
9
7,031
Posted By shaan4uster
Need Help
Yet not able to achieve it.Plz help me.
9
7,031
Posted By shaan4uster
awk 'NR=FNR {A[$1]=$1;next} {print $1}' file2...
awk 'NR=FNR {A[$1]=$1;next} {print $1}' file2 file1

IT generates

1
2
3


Please use code tags...
9
7,031
Posted By shaan4uster
NR=FNR
cat file1
1 a b c
2 d e f
3 a f r
cat file2
a c e

output should be
1
3

means:

if field 1 of file2 matches filed 2 of file1 then print field 1 of file1

I know that it can be done...
1,012
Posted By shaan4uster
Thanks to all
/usr/xpg4/bin/awk 'NR==FNR{A[$0]="\"MATCH\""; next}{print $0,A[$0]}' FileB FileA

Working.
1,012
Posted By shaan4uster
---------- Post updated at 12:50 PM ----------...
---------- Post updated at 12:50 PM ---------- Previous update was at 12:48 PM ----------

Tried it.It is not generating any error message.But also not generating desired output
1,012
Posted By shaan4uster
Matching and appending
I have two files

FILEA
a/b/c/d
e/f/g/h
i/j/k/l
m/n/o/p

FILEB
i/j/k/l

i want that if lines of FILEB matches lines of FILEA then matching lines in FILEA to be appended by word "MATCH"
...
Showing results 1 to 7 of 7

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