SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: writing .csv

  1. #1
    SitePoint Enthusiast davidorsini's Avatar
    Join Date
    Nov 2006
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    writing .csv

    I am currently running a script that writes to a .csv file in batch. It writes 30 lines, then the page refreshes and writes 30 more. I go on in this fassion until the file is done (sometimes 60 lines, sometimes 1000). I have been experiencing some page timeouts with this script though. I notice this happening once the file gets a bit bigger. The page is timing out on the cffile append statement. Does anyone know if takes longer to write a line to a file with 400 lines than it does to a file with 0? Does anyone have any suggestions on a better way to do this?

    I am currently hosting with Crystal Tech and they have a 30 second CF timeout.
    David Orsini
    Atlanta, GA
    Georgia Tech

  2. #2
    SitePoint Enthusiast davidorsini's Avatar
    Join Date
    Nov 2006
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, the original script did a cffile append for each line... i am now appending a variable with the linebreak char(10) and appending my file only once per page load. This seems to be working a lot better. I have succesfully completed a 4751 line file. It is still taking forever but I think the bottleneck now is the actual query.
    David Orsini
    Atlanta, GA
    Georgia Tech

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suspect that if your file gets too much longer, you might consider dropping into Java to work with it.

    There was a discussion about this on the CF-Talk mailing list a month or two ago:
    http://www.houseoffusion.com/groups/cf-talk/

    Give it a look.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •