1
I have two files. A file contains words like a dictionary and another file, contains logs. I would like the file containing the information (Dictionaries) to be removed from the Log file. Remove the full 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 that he reads the list of dictionaries line by line and as he does not find the reference he saves in filtrado.txt. Thus the filtered.txt file is around 180 MB, while the original Log file is only 3 MB.
Contents of x.txt
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;
Grateful.
Enter the programming language used.
– Sam
I used Regular expression, shell.
– user54154
What are the contents of the files? At least one part.
– Murillo Goulart
I edited my comment with the content.
– user54154