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 ....

¿Fue útil?

Solución

  1. 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.
  2. Then execute command "sort -u f1.text > f2.txt"
  3. Combine the words of f2.txt into a line or lines if required.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top