AWK field seperator question
Larry Starr,Mezzanine,46971,5638828
starr at mrsvr.UUCP
Fri Feb 16 07:01:50 AEST 1990
>From article <"900215154914.75046.606.CHD39-1"@CompuServe.COM>, by 75046.606 at CompuServe.COM (Larry W. Virden):
> 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.
>
> [ stuff about previous attempts deleted ]
Why not try something straight forward ( and supported )
n = split($0,x,"\"")
print x[2]
This splits the input record around the quote into aray x
you might want to check n to see how many fields resulted
etc.
The FS variable is used when awk reads the record so the
result of your first attempt is to set FS for the next
record ( not the current one).
-L. Starr
--
Larry Starr
MR Research Facility
G.E. Medical Systems
More information about the Comp.unix.questions
mailing list