Yeah I would definitely start with a smaller file while testing..
maybe 5-10 rows and make sure things are working before trying it on a
5 million row file.

Also the query idea...
I would use
Select * from table
where rownum < 2

I believe using the max rows happens after the query.. So CF loads all
records and then truncates the 1.. so use rownum if possible.


On Fri, 3 Dec 2004 11:21:28 -0500, Dave Carabetta <[EMAIL PROTECTED]> wrote:
> On Fri, 3 Dec 2004 10:37:54 -0500, Joe Rinehart <[EMAIL PROTECTED]> wrote:
> 
> 
> > Yep - this should get you started:
> >
> > <cfscript>
> >    filename = "/path/to/file.csv";
> >    fileReader = createObject("java", "java.io.FileReader");
> >    fileReader = fileReader.init(filename);
> >    lineReader = createObject("java","java.io.LineNumberReader");
> >    lineReader = lineReader.init(fileReader);
> >
> >    line = lineReader.readLine();
> >
> >    /* this'd keep reading in lines
> >    while (isDefined("line")) {
> >      lineCount = lineCount + 1;
> >
> >      // do something here with the data in variable line
> >
> >      line = lineReader.readLine();
> >    }
> >    */
> > </cfscript>
> >
> > <cfoutput>#line#</cfoutput>
> >
> 
> Shouldn't there be a .close() statement in there somewhere at the
> bottom? Otherwise you're going to have tons of open files on your
> system (I learned this one the hard way!!).
> 
> Regards,
> Dave.
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:186091
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to