1833712 Members
2053 Online
110063 Solutions
New Discussion

Re: Awk: Help

 
SOLVED
Go to solution
Robert Fisher_1
Frequent Advisor

Awk: Help

Hello everybody,

I am trying to process some very large input lines with awk and I keep getting the error "awk: Input line cannot be longer than 3,000 bytes. The source line number is 59.

I've done a man of awk but I don't see anything to increase the input line limit. Is there a patch for this?

TIA, Bob
9 REPLIES 9
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Awk: Help

Hi Bob:

You can probably search on "awk" and "3,000" and get several answers; here's my response to a question very much like yours:

-----------------------------------------


That question has come up before and the answer is to use the Gnu version of awk 'gawk' which removes those restrictions. You can download an executable version from any of the HP-UX Porting Centre's.

http://hpux.cs.utah.edu/hppd/hpux/Gnu/gawk-3.1.0/

You will find that gawk is compatible with your version of awk and is in fact a superset of awk. Download it and you should be all set.

Regards, Clay

If it ain't broke, I can fix that.
David Burgess
Esteemed Contributor

Re: Awk: Help

It might be a limit in awk. You could try gawk from http://hpux.connect.org.uk

Regards,

Dave.
Clemens van Everdingen
Honored Contributor

Re: Awk: Help

Hi,

Read this thread:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xe0487b8d1de3d5118ff40090279cd0f9,00.html

Also try to use GNU Awk from:

http://hpux.cs.utah.edu/hppd/hpux/Gnu/gawk-3.1.0/

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
hpuxrox
Respected Contributor

Re: Awk: Help

HPUX default awk does not support files that large. You will need gawk for that support.

http://hpux.cs.utah.edu/hppd/hpux/Gnu/gawk-3.1.0/

-Yates
harry d brown jr
Honored Contributor

Re: Awk: Help

perl? Seriously, when messing around with such huge lines, perl is much better suited for the job.


live free or die
harry
Live Free or Die
James R. Ferguson
Acclaimed Contributor

Re: Awk: Help

Hi Robert:

This is a limitation in HP-UX 'awk'. Get a copy of the gnu version:

http://gatekeep.cs.utah.edu/hppd/hpux/Gnu/gawk-3.1.0/

Regards!

...JRF...
S.K. Chan
Honored Contributor

Re: Awk: Help

Just try this first ..

Set kernel parameter large_ncargs_enable=1 in SAM and rebuild the kernel, then reboot.
S.K. Chan
Honored Contributor

Re: Awk: Help

.. only if you're on 10.20, not needed for 11.x..
Robert Fisher_1
Frequent Advisor

Re: Awk: Help

Hello everybody:

I installed gawk and it worked.

S.K, I was going to adjust my kernel but I couldn't find the value you listed. I then did a search on 'awk', '3,000', and 'large_ncargs' and I found a thread that both A. Clay and JRF answered and it explained about the ncargs problem rather forcefully. I guess I should have mentioned that I am on HP-UX 11i.

Thanks for all the quick responses.

Bob