- Put the words on different lines in your file, say, f1.txt. You may refer to How to replace a character by a newline in Vim? for this.
- Then execute command "sort -u f1.text > f2.txt"
- Combine the words of f2.txt into a line or lines if required.
How to remove duplicate words from a plain text file using unix commands on windows
-
28-06-2022 - |
Pregunta
I have a plain text file with words, which are separated by comma, for example:
word1, word2, word3, word2, word4, word5, word 3, word6, word7, word3
i want to delete the duplicates and to become:
word1, word2, word3, word4, word5, word6, word7
There is a realy good article for Linux already So i installed gnuwin .... an gave up after a 1 h ....
Solución
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow