Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!apple!uokmax!occrsh!att!cbnewsh!shun From: shun@cbnewsh.att.com (shun.cheung) Newsgroups: comp.unix.questions Subject: Re: Awk Field Separators Message-ID: <1990Aug22.212428.19201@cbnewsh.att.com> Date: 22 Aug 90 21:24:28 GMT References: <3729@se-sd.SanDiego.NCR.COM> Distribution: comp.unix.questions Organization: AT&T Bell Laboratories Lines: 19 In article <3729@se-sd.SanDiego.NCR.COM> cubbage@se-sd.SanDiego.NCR.COM (Sharon Cubbage) writes: > >Does anybody know how to specify more than one field separator in Awk? >I would like to specify to an Awk program to treat single spaces as well >as bars as field separators so that a string such as : > >12 12 12 34|34|34 > >will be said to have 6 fields. I've tried to create a regular expression This can be achieved by re-defining the field separator to be a blank or a "|": FS = "[\ \|]" -- -- Shun Cheung, AT&T Bell Laboratories, Middletown, New Jersey electronic: shun@hou2d.att.com, att!hou2d!shun, or shun@cbnewsh.att.com voice: (201) 615-5135