AWK Question

David Huelsbeck dph at crystal.lanl
Fri Oct 6 07:57:21 AEST 1989


It's been a little while since I did much awking but I did A LOT of it
at one time.  I'm not sure if it's the same in the new awk but in the
old awk setting FS to null gave you the default field separator of
whitespace.  That is, if you set it to space or tab, single spaces and
tabs would separate fields so a series of either would give you a bunch
of null fields, but setting it to null gave you the default behavior back.

So your:
> BEGIN {FS=""}
doesn't do anything at all.

The correct technique is to use substr().  This has already been addressed
by others so I'll spare you all the grief of seeing it again.


-dph (still waiting for comp.lang.awk)



More information about the Comp.unix.questions mailing list