Path: utzoo!utgpu!watserv1!watmath!att!mcdchg!laidbak!ism.isc.com!uunet!samsung!sol.ctr.columbia.edu!emory!audfax!arnold From: arnold@audiofax.com (Arnold Robbins) Newsgroups: comp.unix.questions Subject: Re: Setting the field seperator in awk(1) Keywords: awk regular expressions Message-ID: <274@audfax.audiofax.com> Date: 19 Oct 90 17:33:20 GMT References: <2453@linac.fnal.gov> Distribution: na Organization: AudioFAX Inc., Atlanta Lines: 19 In article <2453@linac.fnal.gov> palkovic@linac.fnal.gov (John A. Palkovic) writes: >I would like to set the field separator in awk(1) so that in addition >to the default separator I could include a comma with white space, >as well as the default case, which is just white space. You have to have either nawk or gawk for this; old awk won't work. Assuming you have nawk or gawk, all you need is FS = "[ \t,]+" This says that fields are separated by runs of one or more blanks, tabs, or commas. The (current) AWK language says that if FS == " ", it's a special case, and is treated as if FS were "[ \t]+", i.e. runs of blanks and/or tabs. -- Arnold Robbins AudioFAX, Inc. | Laundry increases 2000 Powers Ferry Road, #200 / Marietta, GA. 30067 | exponentially in the INTERNET: arnold@audiofax.com Phone: +1 404 933 7612 | number of children. UUCP: emory!audfax!arnold Fax-box: +1 404 618 4581 | -- Miriam Robbins