Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!convex!felps From: felps@convex.com (Robert Felps) Newsgroups: comp.unix.questions Subject: Re: Awk Field Separators Message-ID: Date: 22 Aug 90 12:34:23 GMT References: <3729@se-sd.SanDiego.NCR.COM> Sender: news@convex.com Distribution: comp.unix.questions Lines: 23 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 >to handle both cases but it hasn't been working. Try nawk(SV3.2 or later) or gawk from GNU! nawk 'BEGIN { FS = "[ |]" } { # awk program ... }' ------------------------------------------------------------------------------ | Robert Felps |-The more you own, | Tech. Assistant Ctr | | Convex Computer Corp | The more you have to fix! | OS System Specialist | | 3000 Waterview Parkway | | felps@convex.com | | Richardson, Tx. 75083 | | 1(800) 952-0379 | ------------------------------------------------------------------------------