Comments on: Idiomatic awk https://backreference.org/2010/02/10/idiomatic-awk/ Proudly uncool and out of fashion Thu, 30 May 2019 08:47:58 +0000 hourly 1 https://wordpress.org/?v=5.8.2 By: waldner https://backreference.org/2010/02/10/idiomatic-awk/#comment-25716 Thu, 30 May 2019 08:47:58 +0000 http://backreference.org/?p=825#comment-25716 In reply to Iulian.

You did it right. Cheers

]]>
By: Iulian https://backreference.org/2010/02/10/idiomatic-awk/#comment-25715 Wed, 29 May 2019 19:49:58 +0000 http://backreference.org/?p=825#comment-25715 In reply to Iulian.

Ok, I have managed to do this with:

awk 'NR == FNR {a[$5];next} $2 in a {print $1} ' file1 file2

If you have any advice please let me know. And sorry for the spam, but i am new in this and really wanted some help :)

Thank you

]]>
By: Iulian https://backreference.org/2010/02/10/idiomatic-awk/#comment-25714 Wed, 29 May 2019 19:23:48 +0000 http://backreference.org/?p=825#comment-25714 In reply to Iulian.

Actually, I have used the command:

awk 'NR == FNR{a[$5];next} $2 in a' Route_guide_1.txt Carrier_associations_1.txt

but it displays the entire line of file2, and I need only the first sequence.

Thanks

]]>
By: Iulian https://backreference.org/2010/02/10/idiomatic-awk/#comment-25713 Wed, 29 May 2019 18:45:02 +0000 http://backreference.org/?p=825#comment-25713 Hi,

Let's say I have file1 and file2. I want to match a sequence in file1 with a sequence in file2 and return the output with some other sequence from file 2. For example, in file1 I have the line:
Jessica Robert 123 USA association

In file 2 I have:
Mike association UK 567

And I want to return Mike from file2.

Thank you

]]>
By: waldner https://backreference.org/2010/02/10/idiomatic-awk/#comment-25607 Tue, 02 Apr 2019 09:56:45 +0000 http://backreference.org/?p=825#comment-25607 In reply to Akshat.

It's not quite clear from your description, an example of input and expected output would be better.

]]>