Working with Arrays in AWK

An array is a variable that is used to store a set of values (strings or numbers). These values, or independent elements, are accessed by their index in the array. Indexes are stored in square brackets and may be either numbers or strings. This chapter focuses on how arrays are implemented in AWK.

In this chapter, we will cover the following topics:

  • One-dimensional arrays in AWK
  • Assigning and accessing elements in arrays
  • Referring to array elements
  • Processing arrays using loops
  • Creating an array using a split function
  • Delete operations in arrays
  • Multidimensional array implementation in AWK

Get Learning AWK Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.