Remove content between two files

1

I have two files. One file contains words as if it were a dictionary and another file contains records of Logs. I would like the file containing the information (Dictionaries) to be removed from the Log file. Remove the entire log line and not just the word.

Unsuccessful attempts:

grep -f dicionario.txt -v logs.txt

or

while read line; do egrep -v "$line" logs.txt; done < dicionario.txt >> filtrado.txt

The first command, generated this error:

grep: Refer▒ncia anterior inv▒lida

The second I believe he reads the list of dictionaries line by line and as he does not find the reference he saves in filtrate.txt. Thus the file filtered.txt is around 180 MB, while the original Log file has only 3 MB.

x.txt content

Aaroon NB / Inv. 8120403678
ABRIGO SALAS  -  RIFA DE MAIO 2018
Academia e fatura cartão
Acesso por celular
Adequate! I wish to talk.
Adesivos
adventurous, I wish to speak:-)
AIR CROSS
Aluguel Anderson - porto feliz
ANALISTA DE FOLHA PGTO SR
Andamento do seu pedido!
angel
angelic How so?

Log.txt

May 10 03:29:23 xxxxxxx[28161]: ID: xxxxx; IP: xxxxx; MSGID: <[email protected]>; X-UOL-SMTP: xxxx; SENDER: <[email protected]>; SUBJECT: Коммерческое предложение главному; URL: xxx.com.br;

Thank you.

    
asked by anonymous 15.05.2018 / 16:57

1 answer

0

Use SED , find a pattern on rows that you want to exclude sed '/<padrão que contem na linha que deseja excluir do arquivo/d' dicionario.txt >> filtrado.txt

    
01.06.2018 / 16:04