2
I have a file txt
but is missing the nome
in several lines of the file, I would like to put the name according to the order number.
The logic would be to check the order number of the line that is without the name in case the request 203885
, find another line that has the same order number and that has a name, take this name and copy it to all equal order numbers. However, order numbers that are not equal have different names. The column that represents requests is column 2.
Original File txt:
100400;205537;30141;BALCAO 1 PORTA PER 400X670X500;MDF BP BRANCO;6;79281905;NOME1;0205537006
100400;203885;50058;PAI OPC EDIT LARGX ALTX 25;BLANCHE#695#320;18;79283198;NOME;0203885018
100400;205537;100001;EMBALAGEM DE FERRAGENS DIVERSAS; ;35;79283215; ;0203885035
100400;203885;101619;EMBALAGEM DE FUNDOS DORMITORIO; ;36;79283216; ;0203885036
After modified it should look like this:
100400;205537;30141;BALCAO 1 PORTA PER 400X670X500;MDF BP BRANCO;6;79281905;NOME1;0205537006
100400;203885;50058;PAI OPC EDIT LARGX ALTX 25;BLANCHE#695#320;18;79283198;NOME;0203885018
100400;205537;100001;EMBALAGEM DE FERRAGENS DIVERSAS; ;35;79283215;NOME1;0203885035
100400;203885;101619;EMBALAGEM DE FUNDOS DORMITORIO; ;36;79283216;NOME;0203885036
Just modify in the file is not necessary to print on screen.
the name will be the same for everyone and should be in this empty space?
– Daniel Omine
If I understood correctly, I would have to compare
$linha[6]
if there is no take the previous value (which is in another variable) . you just want to print it on the screen?– rray
I want to change in the same file print on canvas is not necessary, but it is in the empty space that should contain the name.
– KevinF
describe which column represents the order codes
– Daniel Omine