Fshah has asked for the wisdom of the Perl Monks concerning the following question:
I have an array which is joined by ';' In the next loop I get empty values I want to find the empty values and replace them by the one's obtained in the previous loop
@first_loop=(1668;1733;60;32;3173;0;2517;58221;55764;0;0;0;0;Td;30720; +1;9;25;0;2; Carry 0); @next_loop=(1671;1661;0;0;;;0;0;0;0;;;;;;1;9;25;0;2; Carry 1);
I want the output in the present array to not have empty values instead have previous value
thank you for the help in advance edit: I have an array of such data in each line I want to perform this operation on entire array1668;1733;60;32;3173;0;2517;58221;55764;0;0;0;0;Td;30720;1;9;25;0;2; C +arry 0 1671;1661;0;0;;;0;0;0;0;;;;;;1;9;25;0;2; Carry 1 1671;1661;;0;;;0;0;0;0;;;;;;1;9;;0;2; Carry 2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to replace empty values with value in previous array
by huck (Prior) on Jul 20, 2017 at 07:08 UTC | |
|
Re: How to replace empty values with value in previous array
by AnomalousMonk (Archbishop) on Jul 20, 2017 at 07:18 UTC | |
|
Re: How to replace empty values with value in previous array
by poj (Abbot) on Jul 20, 2017 at 07:58 UTC | |
by Fshah (Initiate) on Jul 20, 2017 at 08:53 UTC | |
by poj (Abbot) on Jul 20, 2017 at 09:07 UTC | |
by Fshah (Initiate) on Jul 20, 2017 at 09:17 UTC | |
by poj (Abbot) on Jul 20, 2017 at 12:23 UTC | |
|
Re: How to replace empty values with value in previous array
by BillKSmith (Monsignor) on Jul 20, 2017 at 16:32 UTC |