Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Awk cannot read line more than 10K

Status
Not open for further replies.

dnivraramuk

Programmer
Dec 2, 2002
7
0
0
US
I am trying to input a record to a awk program which has a line having 25000 char. When I read the line and print $0 in the program it is returning only 10240 characters. Even doing a length is returning the same count.

Could any one tell me how to change this setting so that it can read the whole line.

regards,
Arvind
 
either use gawk [might have a higher/no limits]
OR
if on Solaris, try either 'nawk' OR /usr/xpg4/bin/awk vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
tried nawk but it did not help. I am working on AIX 3.4.
Don't have gawk installed to check it up..
 
$ gawk --version
GNU Awk 3.1.0

works fine with 25K FIELDS - numeric fields from 1 to 25000

(if it's any reconciliation) vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Or if you have perl, you may be able to convert your awk script to a perl script using a2p and use perl instead of awk. CaKiwi
 
CaKiwi - where can I find a2p - it would be VERY useful for me, too.
;-) Dickie Bird
Honi soit qui mal y pense
 
a2p should come with the standard perl distribution. CaKiwi
 
You can also break the line in peaces with a small C program.
I made a program where I can pipe true large lines.
Long lines go in small lines come out.

Regards Gregor
Gregor.Weertman@mailcity.com
 
If breaking lines is acceptable input for your app then do a man on the fold command.

e.g.

fold -w 100 input | theApp
Cheers,
ND [smile]

bigoldbulldog@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top