O'Reilly logo

Learning AWK Programming by Shiwang Kalkhanda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the split() function to create arrays

The built-in split() function can parse any string into elements of an array. The split(string, arr, fs) function splits the string value of str into fields and stores them in the arr array. The number of fields produced is returned as the value of the split function. The string value of the third argument, fs, determines the field separator. The syntax of split() functions is as follows, followed by a listed explanation of the elements involved:

n = split (str, arr, fs)

  • str: This is the input string to be parsed into the elements of the named arr.
  • arr: This is the name of the array.
  • fs: This is the separator character based on which the array elements are split. If the separator is not given, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required