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
I realized I forgot all about the <cr>. I solved it this way - just for the records.
my $i = 0; (chomp $_->[1], $_->[2] = $i++) for @multi_array;
However, printing looks slighty odd due to a missing blank.
I wonder why.print join(",", @{$_}),"\n" for (@multi_array); 4.20064619e-03, 5.30384531e+04,91 4.24680719e-03, 5.28570000e+04,92 ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: adding an index column to a csv data file
by swl (Prior) on Jun 02, 2019 at 22:18 UTC | |
by ng0177 (Acolyte) on Jun 03, 2019 at 13:23 UTC | |
by hippo (Archbishop) on Jun 03, 2019 at 17:59 UTC | |
by ng0177 (Acolyte) on Jun 03, 2019 at 18:16 UTC | |
by haukex (Archbishop) on Jun 03, 2019 at 18:25 UTC | |
by ng0177 (Acolyte) on Jun 03, 2019 at 16:42 UTC | |
by poj (Abbot) on Jun 03, 2019 at 17:43 UTC | |
by swl (Prior) on Jun 04, 2019 at 02:44 UTC |