Record Length too long -- AWK Problem

Hi All,
I have a txt file which is an export of a query result from the database. The txt file contains 'Processid#sqlquery' from the database table.As the sqlquery is too long.... i am unable to get the fields seperated using the awk script as below:-

cat sql.txt | awk -F'#' '{printf $2}'
Error:-
awk: record ` 16355#SELECT EDW_RE...' too long

My objective is to have Processid as txt file name which contains that particular query. So for each row of Processid#sqlquery i shud be creating a processid file containing that particular sql. Please help me with ur suggestions!!

Thanks,
Ajay

With printf you'll get an output of one long line. Try:

{print $2}

or

{printf $2 "\n"}

Regards

Since awk has limitations of the size of input it can take in one line try the following:
cat sql.txt | perl -e 'print (split (/#/,$))[1]'
split works like the FS of awk, but the field count starts from 0
if you need a newline after the output use:
cat sql.txt | perl -e 'print (split (/#/,$
))[1] . "\n"'