Timeline for remove duplicates based on the value of another column
Current License: CC BY-SA 3.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 21, 2017 at 15:18 | comment | added | Sundeep | @terdon because -u will retain the first line found from input file among duplicates... for given case, input has to be sorted before -u can be applied... for ex: AA,true will be printed instead of AA,false since it appears first in given sample.. same reason why awk -F, '!a[$1]++' alone won't solve this problem | |
| Jul 21, 2017 at 14:59 | comment | added | terdon♦ | @Sundeep why use two sort calls? Why not just sort -ut, -k1,1 input.txt ? | |
| Jul 21, 2017 at 7:58 | comment | added | Sundeep | also, if -u option is available, sort input.txt | sort -t, -u -k1,1 | |
| Jul 20, 2017 at 21:35 | history | answered | Wildcard | CC BY-SA 3.0 |