Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 5, 2024. It is now read-only.

Commit f5877e2

Browse files
improved example for multiple field duplicate detection
1 parent 6aeebc7 commit f5877e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎gnu_awk.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1712,9 +1712,10 @@ $ awk -M '!(2ドル in seen){c++} {seen[2ドル]} END{print +c}' duplicates.txt
17121712

17131713
* For multiple fields, separate them using `,` or form a string with some character in between
17141714
* choose a character unlikely to appear in input data, else there can be false matches
1715+
* `FS` is a good choice as fields wouldn't contain separator character(s)
17151716

17161717
```bash
1717-
$ awk '!seen[2ドル"_"3ドル]++' duplicates.txt
1718+
$ awk '!seen[2ドル FS 3ドル]++' duplicates.txt
17181719
abc 7 4
17191720
food toy ****
17201721
test toy 123

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /