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

Awk does not have numerically-indexed arrays at all. There is a convention for using digit strings to emulate numeric indexing, and like Perl, Awk will convert numbers to digit strings upon demand, but Awk arrays are Perl hashes.

  • Comment on Re^10: Split tab-separated file into separate files, based on column name (open on demand)

Replies are listed 'Best First'.
Re^11: Split tab-separated file into separate files, based on column name (open on demand)
by LanX (Saint) on Aug 29, 2020 at 13:51 UTC
    yes Awk is - similar to JS - using the same datatype for Arrays and Hashes, but ...

    > Awk does not have numerically-indexed arrays at all.

    Awk has implicitly numbered arrays like ARGV

    And ARGV[1] corresponds to $ARGV[0] in Perl

    Similarly will awk's split() index the first element with 1 in the resulting "array".

    And the first field from auto-split is $1 not $0 , while perl -a will put it into $F[0]

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery