aa="sad,23,d,23,sf,3,wer,32,23"
'字符串
split(aa,",")(0)
'以豆号分割,取sad字符串
split(aa,",")(2)
'取d字符串

aa="http://www.domain.com/index.asp?str=aaa"
split(aa,".")
'以点分割
split(aa,"/")(2)
'分割后取域名 www.domain.com
split(aa,"?")(1)
'用?号分割,取srt=aaa


数组与split函数:
awk的内置函数split能够将字符串拆分为词,然后保存在数组中。
格式:split(字符串,数组, 字段分隔符)
      split(字符串,数组)
awk 'BEGIN{ split ("3/15/2004", date, "/"); print "The month is ", date[1], date[2], date[3]}' datafile
awk 'BEGIN{split("zhang/zhi/chao", name, "/"); print name[1], name[2],}' datafile