in reply to Re: adding an index column to a csv data file
in thread adding an index column to a multi-array derived from a csv data file
my $i=0; $_->[2] = $i++ for @multi_array;
works for me too now after resetting $i which masked it.
You are right, the present data set has two columns and the other one three. I should have mentioned that.
Thanks for helping out. The generalisation is useful to have.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: adding an index column to a csv data file
by AnomalousMonk (Archbishop) on Jun 02, 2019 at 17:08 UTC | |
by ng0177 (Acolyte) on Jun 02, 2019 at 17:44 UTC |