[Tutor] How long can a line be for readline() or readlines() ?? ((LONG)) file, example and console

Lloyd Kvam lkvam@venix.com
Fri, 09 Nov 2001 13:33:01 -0500


How do you know that line is the culprit?  I can't run your script 
directly, but I suspect that there is an extra (empty??) line in the 
file that is breaking it.

The long line works in my extract of your script!

Schmidt, Allen J. wrote:

> Each line has actually 6 pipes:
> |adnum|logo|adtext|catnum|RM|
> 
> The RM on the end is a holdover from when the text was processed a different
> way.
> 
> Lines under 2k go in without a hitch. The line I sent is one over the 2k
> limit.
> 
> -----Original Message-----
> From: Lloyd Kvam [mailto:lkvam@venix.com]
> 
> THIS is your problem area:
> 
>   lineout=string.split(lineout,'|')
>           sql="insert into current (adnum, logo, rundate, runday, status,
> adtext, category) values
> ('"+lineout[1]+"','"+lineout[2]+"','"+date+"','"+day+"','ENABLED','"+lineout
> [3]+"','"+lineout[4]+"')"
> 
> lineout becomes a list of lines that is made up of those pieces between 
> the |s of the orinal lineout.  The sql statement requires that the 
> lineout list contain at least 5 lines.  Thus there needs to be at least 
> 4 |s in the original lineout.
> 
> 


-- 
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice: 
603-443-6155
fax: 
801-459-9582