Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!rutgers!mephisto!mcnc!rti!sunpix!matthew From: matthew@sunpix.East.Sun.COM ( Sun Visualization Products) Newsgroups: comp.unix.questions Subject: Re: AWK field seperator question Message-ID: <1150@greens.East.Sun.COM> Date: 17 Feb 90 20:22:43 GMT References: <"900215154914.75046.606.CHD39-1"@CompuServe.COM> Organization: Sun Microsystems, Research Triangle Park, NC Lines: 37 In article <"900215154914.75046.606.CHD39-1"@CompuServe.COM> 75046.606@CompuServe.COM (Larry W. Virden) writes: ]I have an awk question. I am using SunOS 4.0.2 on a Sun 386i. ]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 ]} Leave the field seperator alone, and try using the split function. n = split(s, arr, sep) n = number of resultant elements s = the string to be disected arr = the name of the array to place the elements sep = the seperation character In your example I would do: /config/ { split($0, LINE, "\"); print LINE[2] } -- Matthew Lee Stier | Sun Microsystems --- RTP, NC 27709-3447 | "Wisconsin Escapee" uucp: sun!mstier or mcnc!rti!sunpix!matthew | phone: (919) 469-8300 fax: (919) 460-8355 |