I have two files, in the first a list of reports and in the second a list of companies for example.
file1.csv
20170112;compra;articulos papeleria;Papeleria Pepito
20170112;compra;tinta impresoras;Distribuidora de todito
20170214;venta;juego de sala;Perico de los palotes
file2.csv
Papeleria Pepito;/tmp/transacciones/PapeleriaPepito
Distribuidora de todito;/tmp/transacciones/DistribuidoraTodito
What I need is to go through the first file1 and if the text of the fourth column matches the first column of file 2 copy that line to the file specified in column two of the same file (col2. archive2) if there is no match it would be sent to a file in a location /tmp/others
You can use 2 nested while of the type:
# #OBS: I did not understand well what you want to do when they are the same, I hope it has helped you to shed light on your idea.