3 ms·
The author states: uniq -u movies.csv > temp.csv mv temp.csv movie.csv **Important thing to note here is uniq wont work if duplicate records are
by jason_slack 12y ago
The author states:
uniq -u movies.csv > temp.csv
mv temp.csv movie.csv
**Important thing to note here is uniq wont work if duplicate records are not adjacent. [Addition based on HN inputs]
Would the fix here be to sort the lines first using the `sort` command first? Then `uniq`?
- icebraining 12y agoYes, but not first, rather instead. "sort -u" both sorts and hides duplicates.
- jason_slack 12y agoThanks for the clarification!
- mzs 12y agoexcept when you need uniq -c
- coderholic 12y agoYes, and in fact you can just use sort's -u (unqiue) argument, and avoid uniq all together.
- jason_slack 12y agoThanks for the clarification!