Thanks,
-Tom
----------------/----------------------------------------------
Tom Rudnick | USDA Natural Resources Conservation Service
Fort Collins,CO | t...@avatar.itc.nrcs.usda.gov (970) 282-1941
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is there such a thing as a Max Awk Record Length? ... Is it adjustable?
...
Any help would be very appreciated ... Thanks.
Junlei
I am not sure about the restriction on the length of record.
Hope this helps
Rajeev
--
Rajeev Shankar
Theoricaly, gawk (GNU awk) hasn't got such a restriction and is free.
Version 2.15p6 works fine. I haven't tested the 3.0.2 version yet.
>
> Is there such a thing as a Max Awk Record Length? ... Is it adjustable?
> ...
>
> Any help would be very appreciated ... Thanks.
>
> Junlei
Hope...
Denis.
>Junlei Li wrote:
>>
>> Hi, All, I am using an awk script to do some log analysis and
>> periodically, I get a "Awk: Record Too Long" error ... and abort.
>I found that kind of restrictions under HPUX (but I think that AIX and
>others have the sames). In my experience under HPUX, awk generated a
>core each time a line had more than 256 caracteres. I think that there's
>a parameter to extend the max length of a line but I'm not sure because
>some functions had bugs and then I used Gawk, see the manual.
>
Since you are using UNIX, you may wish to 'chop' it up into
fixed lengths of 'reasonable' length and then reassemble them
within the awk
fold -80 data-file | awk -f prog1.awk etc
Where prog1 contains something like this
if (NR % sub-lines-per-record != 0) {
line = line $0; next}
temp=line; $0=line; line=temp
You may have to split it into $1, $2 etc with a split statement
Note: this is unchecked !
Mark
--
Mark Katz
ISPC, London - Innovation in data-delivery tools
Tel: (44) 181-455 4665, Fax (44) 181-458 9554
** Visit our website on http://www.efiche.com/efiche **
> Junlei Li wrote:
> >
> > Hi, All, I am using an awk script to do some log analysis and
> > periodically, I get a "Awk: Record Too Long" error ... and abort.
> I found that kind of restrictions under HPUX (but I think that AIX and
> others have the sames). In my experience under HPUX, awk generated a
> core each time a line had more than 256 caracteres. I think that there's
> a parameter to extend the max length of a line but I'm not sure because
> some functions had bugs and then I used Gawk, see the manual.
>
> Theoricaly, gawk (GNU awk) hasn't got such a restriction and is free.
> Version 2.15p6 works fine. I haven't tested the 3.0.2 version yet.
>
> >
> > Is there such a thing as a Max Awk Record Length? ... Is it adjustable?
From "Four AWK implementations for MS-DOS", 1989-1993, George
Theal.
Maxmimum Record Size:
DUFF_AWK 1024
GAWK 16384
MKS_AWK 2048
POLY_AWK 32000
16384 is pretty good for a record length. If your records are
longer than this, it seems awfully likely that your record seperator is
not what it should be, and you *should* get an error message to tell you
about it. 1024 (for example), or 256 is a lot less comfortable.
Virtually,
Bruce R. McFarling, Newcastle, NSW
ec...@cc.newcastle.edu.au
On Wed, 02 Jul 1997 12:59:10 -0700, Junlei Li <tu1...@ibm.net> wrote:
>Hi, All, I am using an awk script to do some log analysis and
>periodically, I get a "Awk: Record Too Long" error ... and abort.
>
>Is there such a thing as a Max Awk Record Length? ... Is it adjustable?
>
> Theoricaly, gawk (GNU awk) hasn't got such a restriction and is free.
> Version 2.15p6 works fine. I haven't tested the 3.0.2 version yet.
gawk also handles far more fields per line and is faster
WARNING: Gawk version 3.0.1 - 3.0.2 have a per record memory leak
which makes them unsuitable for processing long files
this has been addressed/fixed in gawk 3.0.3
Jennifer Cross
busy body down under