Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • Hi, I've just tested and it seems to work however what i stupidly failed to mention is that there will be duplicate lines, any ideas please Commented Dec 23, 2015 at 11:47
  • 1
    @ChrisJ There are a lot of ideas, but you need to show sample input and expected output with duplicate lines. Commented Dec 23, 2015 at 11:51
  • 1
    @ChrisJ Definitely there is no 400 lines limit in awk. Commented Dec 23, 2015 at 12:10
  • 1
    @BumblingBadger See the edit. Commented Nov 14, 2020 at 10:09
  • 1
    @BumblingBadger The question was modified multiple times and honestly I do not understand what OP wanted to do. Other answers in this topic don't help solving this mystery either. Looking at it right now I think that the most sense is to match bart-computer, apu-computer, smithers-keyboard and lisa-keyboard, so I changed my second answer once again accordingly. So I just switched input files and left "duplicates'. If you have similar problem and just want to select first record add ,a[$2]="" before last }. Commented Nov 16, 2020 at 8:55