1
I need to delete an entire line through a word that I will define and at the same time delete another line as well, but now it must be in another file that corresponds to the line of the first file. As in the example below:
1º Arquivo - Nome.txt 2º Arquivo - Sobrenome.txt Benedito Amaro Texeira Paulo Souza da Cunha Ricardo Ramos Faria Carlos Eduardo Neto Angelita Gusmões Filho Davi Onorato Favaro
Manually I would delete like this here:
sed -in '/^Ricardo/' Nome.txt ; sed -i '3d' Sobrenome.txt
What I need to know is a means to automate the second command sed
, so I can delete the corresponding line that was deleted in the first.
That is, I need to delete two lines one in the first and the other in the second file, both, correspond in the same SEQUENCE and POSITION of the line between the file NAME and SURNAME.