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*

5
  • if you do use !a[$1, $6]++ (which is better you do it) instead of the !a[$1 $6]++, are you geting the same wrong output? what is the field delimiter of your input file? what is your file type file input.csv? Commented Oct 14, 2022 at 16:11
  • I can't get the same failure as you with your code and data, although that command may be shortened to awk '!a[$1,$6]++' file. Commented Oct 14, 2022 at 16:12
  • its a csv file, that's strange, I still get 3 records with awk '!a[$1,$6]++' file Commented Oct 14, 2022 at 16:22
  • @nbn It's not a CSV file, there does not seem to be a fix field delimiter. awk will use any sequence of spaces and/or tabs as the delimiter. If one of your fields contain spaces or tabs, it will be treated as more than one field by awk. You have no such data in your example in the text as far as I can see, unless ABC XYZ DOP or 2022-08-18 13:31:09Z is supposed to be a single field. Commented Oct 14, 2022 at 16:25
  • 2022-08-18 13:31:09Z is one field but ABC XYZ DOP are all three different columns Commented Oct 17, 2022 at 7:51