in reply to Re^9: Split tab-separated file into separate files, based on column name (open on demand)
in thread Split tab-separated file into separate files, based on column name
Did you try the code?
That's how I discovered the issue... ;-P
I think the issue is that awk's arrays are not zero based.
I checked, and older versions of a2p did indeed set $[ = 1; - apparently while having other strange bugs in the output, it looks like to me (at least on my system, the output is strangely chopped up, e.g. "next linine;" or "}tinue {"). After 5.10, a2p dropped the $[ assignment, but added adjustment of array indicies in some places, while not adjusting the array indicies in other places, e.g. for ($i = 1; $i <= $#Fld; $i++) { $Fields[$i] = $Fld[$i]; } became for ($i = 1; $i <= ($#Fld+1); $i++) { $Fields[($i)-1] = $Fld[$i]; }.
|
|---|