words("string") returns the number of words in string. For example, words(" a b c d") returns 4.
The word and words functions provide limited support for quoted strings,
both single and double quotes can be used:
print words("\"double quotes\" or 'single quotes'") # 3
print words("Alexis' phone doesn't work") # 4
s = "Keep \"'single quotes'\" or '\"double quotes\"'" print word(s, 2) # 'single quotes' print word(s, 4) # "double quotes"
trim(" padded string ") returns the original string stripped of leading
and trailing whitespace. This is useful for string comparisons of input
data fields that may contain extra whitespace. For example
plot FOO using 1:( trim(strcol(3)) eq "A" ? $2 : NaN )