awk file size limit

My code is

awk '{

out=split(FILENAME,a,"/")
sub(/\./,"",a[out])
sub(/\-/,"
",a[out])
NEWSTRING="main_"a[out-1]"_"a[out]"(" # The word we want to insert
gsub(/main\(/,NEWSTRING); # the word to be replaced
print "Main becomes ",NEWSTRING")","in file ",FILENAME >> "/home/ds2/test/NEW2.txt"
print NEWSTRING")" >> "/home/ds2/test/MAIN2.txt"
print FILENAME >> "/home/ds2/test/NAME2.txt"
print $0 > FILENAME;

}' $FNAME

if the input size was more than 4K the function fails,,,, so pls any suggestions???

Depending on the OS gawk (GNU awk) handles longer lines, more fields, more records and bigger files and is compatible with awk. Take a look at:
The GNU Awk User's Guide

Maybe there are more approaches to solve the problem, post your input file and the desired outputs.

Regards

dear tony,, I tried gawk but nothing happens,,, pls help me urgently....

Is gawk installed try running:

# updatedb; locate gawk | grep bin

# rpm -q gawk

# whereis gawk

# type gawk

If none of those give a positive response then you do not have it installed.

What operating system are you running please?