Nyan
Nyan

Reputation: 2461

Why not add reference and multi-dimensional array to awk language

I'm wondering is there any implementation of awk that has reference(like in perl) or something similar to build complex data structure? Adding such feature would make awk more powerful. Will posix standard adds such kind of feature in future?

Upvotes: 0

Views: 99

Answers (1)

Dr. belisarius
Dr. belisarius

Reputation: 61046

Multidimensional arrays are supported in gawk.

From the manual:

 {
      if (max_nf < NF)
           max_nf = NF
      max_nr = NR
      for (x = 1; x <= NF; x++)
           vector[x, NR] = $x
 }

References are not, and I think referencing is not "the awk way".

HTH!

Upvotes: 1

Related Questions