Groups | Search | Server Info | Login | Register
| From | Philip <phil.ganchev@gmail.com> |
|---|---|
| Newsgroups | comp.lang.awk |
| Subject | Re: Field separator ") " |
| Date | 2011-04-08 13:50 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <f0e22995-71a5-43f0-8c15-fa3115a7c42c@i14g2000yqe.googlegroups.com> (permalink) |
| References | <9d58baa3-335b-4355-981f-98864946391a@r6g2000vbz.googlegroups.com> <inns5v$ulr$1@speranza.aioe.org> |
On Apr 8, 4:42 pm, pk <p...@pk.invalid> wrote:
> On Fri, 8 Apr 2011 13:41:06 -0700 (PDT)
>
>
>
> Philip <phil.ganc...@gmail.com> wrote:
> > How can I use ") " as the field separator? The manual says that if FS
> > is a string of more than one character, then it is treated as a
> > regular expression. But when I try this it does not work:
>
> > awk -F '\) ' '{print "hello"; exit}' mydatafie
> > awk: warning: escape sequence `\(' treated as plain `('
> > awk: fatal: Invalid regular expression: / (/
>
> Use -F '\\) ' or -F ' \\('
Thanks!
Why is that? As far as I can tell, Awk receives the string that is in
the single quotes unchanged. So -F '\( ' should work.
And why does '\(' without the space work?
Back to comp.lang.awk | Previous | Next — Previous in thread | Next in thread | Find similar
Field separator ") " Philip <phil.ganchev@gmail.com> - 2011-04-08 13:41 -0700
Re: Field separator ") " pk <pk@pk.invalid> - 2011-04-08 21:42 +0100
Re: Field separator ") " Philip <phil.ganchev@gmail.com> - 2011-04-08 13:50 -0700
Re: Field separator ") " pk <pk@pk.invalid> - 2011-04-08 22:01 +0100
csiph-web