Table 2. Built-in awk Functions

length(str): returns the number of characters in the passed parameter. If the parameter is omitted, the length of $0 is returned.

int(param): returns the integer portion of the parameter if it begins with a numeric value. Otherwise, 0 is returned.

index(str1,str2): returns the index of str2 in str1. If str2 is not matched, 0 is returned.

split(str,arr,del): places field of str delimited by del, in the arr array.

split(): returns the number of delimited fields.

substr(str,pos,len): returns the substring of str that begins at position pos and is len characters in length.