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

String functions

The built-in string functions are much more significant as AWK is primarily designed as a string-processing language. These functions enhance AWK's power and functionality. In this section, we will discuss the following functions in detail:

  • index (str, sub)
  • length (string)
  • split (str, arr, regex)
  • substr (str, start, [ length ])
  • sub (regex, replacement, string)
  • gsub (regex, replacement, string)
  • gensub (regex, replacement, occurrence, [ string ])
  • match (string, regex)
  • tolower (string)
  • toupper (string)
  • sprintf (format, expression)
  • strtonum (string)

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