On Thu, 26 Feb 2004, [iso-8859-2] Roubí?ek Zden?k (T-Systems PragoNet) wrote:

>
>  Hello questions
>
>  Any idea what I am missing?
>
> >cat test
> 1;1
> 2;2
> >awk -F ';' '{print $1}'
> 1
> 2
> >awk -F ' FS=";" {print $1}'
> 1;1
> 2
> >

The FS=";" is a pattern expression that is used to match the first line
of input, after it has already been split into fields. It evaluates true
so the block it guards is always run. After the first line has been
dealt with, future lines will be split using the new FS setting. As
another poster supplied, slap the FS setting in a BEGIN-guarded block.

-- 
jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
Tel +44(0)117 9287088 Fax +44 (0)117 9287112 http://ioctl.org/jan/
If it's broken really badly - don't fix it either.
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to