in reply to Re^2: 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
It is probably due to the split not cleaning up leading spaces, or possible sequential spaces. It is hard to say without seeing that part of the code and the data.
Could you provide the code and some example data? Your other response indicates it is not the same as your previous post.
In any case, it could be cleaned up using a map or another loop, possibly embedded in your other code (but that could become a bit too obfuscatory).
@arr = map {s/^\s+//} @arr;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: adding an index column to a csv data file
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 | |
|
Re^4: adding an index column to a csv data file
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 |