Path: utzoo!utgpu!watserv1!watmath!att!dptg!ulysses!andante!alice!paul From: paul@alice.UUCP (Paul Krzyzanowski) Newsgroups: comp.unix.questions Subject: Re: AWK field seperator question Summary: resetting field separator in awk Message-ID: <10489@alice.UUCP> Date: 16 Feb 90 02:45:17 GMT References: <"900215154914.75046.606.CHD39-1"@CompuServe.COM> Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 30 In article <"900215154914.75046.606.CHD39-1"@CompuServe.COM>, 75046.606@CompuServe.COM (Larry W. Virden) writes: > I want to , within a particular pattern { action }, reset the > Field Seperator, process the current record, then set the FS back > to the default action. > > To do this, I tried: > /config/ { > FS = "\""; print $2 ; > FS = "" > next > } > > { > print $1, $2 > } The program isn't doing what you want because you aren't "resetting" the field separator. Setting FS to an empty string doesn't reset FS to its previous value; you have to explicitely set it to use white space as a separator. Try FS = " " instead of FS = "" -Paul Krzyzanowski paul@allegra.att.com