Unexpected exit

Asked

Viewed 54 times

1

I am running this command to remove repeated lines from a file:

cat arquivo.csv | (read;echo "$REPLY"; sort) | uniq > arquivo.csv

But when I look at the file, it’s blank instead of just the lines that don’t repeat. What I’m doing wrong?

  • 1

    I’ve always used the cat | sort | uniq > novo_nome, If it is with the same name it is without content, now I do not remember what was the explanation for this

2 answers

0

You can use the command:

cat arquivo.csv | sort | uniq > novoArquivo.csv

0


You can do this using apernas the Sort.

sort -u arquivo.csv -o arquivo.csv
  • -u will remove duplicate lines
  • -o will send the output to the.csv file

Browser other questions tagged

You are not signed in. Login or sign up in order to post.