Arrays
Arrays are a mechanism for storing multiple elements in a data structure.
- Arrays in AWK are associative arrays.
- Elements are not stored in any particular order and an “association” is formed between the array index and the elements being stored.
- Square brackets are used to hold the index values.
- The command my_stuff[“mine”] = 12, will store the value “12” into index position “mine” of the array “my_stuff”.
- Examples awk_prog10a (awk_data10a) and awk_prog10b (awk_data10b).