[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FPAT patch for gawk
From: |
Aharon Robbins |
Subject: |
FPAT patch for gawk |
Date: |
Fri, 8 Feb 2002 17:43:31 +0200 |
I just posted the following to comp.lang.awk:
From: address@hidden (Arnold Robbins)
Newsgroups: comp.lang.awk
Subject: A winter present for all you gawk fans
Message-ID: <address@hidden>
Greetings everyone. After all the endless posts on CSV data, I decided to
whip up a present for all the loyal awk/gawk fans out there, to help
you get through these dreary winter days.
In particular, I added FPAT to gawk. Based on the idea (only! no code)
from Thompson awk, you assign a string containing a regular expression
to FPAT, and then gawk sets the fields to be the text that matches
the regular expression. If FPAT is null or doesn't match, $1 is set
to the whole record.
Included in the patch (in the gawk.texi file) is an example program for
parsing (at least one kind of) CSV. It's rather neat, even if I say
so myself. (:-)
The patch is provided against 3.1.0. This will eventually go into
the 3.2 source tree, but I thought I'd release it early to give everyone
something to play with, and to get any feedback on either the code
or the documentation. In the meantime, I'gm working on 3.1.1, which will
be a bugfix release.
ftp://freefriends.org/arnold/Awkstuff/gawk-3.1.0-FPAT.patch.gz is
where to get the patch from. (Sorry, no pre-built binaries and no
full distribution. You'll have to apply the patch and rebuild from
source.)
Enjoy,
Arnold Robbins
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FPAT patch for gawk,
Aharon Robbins <=