SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reading csv file (30MB)

    Hi All

    I have large csv file (30MB) . I want to insert the contents to multiple tables. I tried this using fgetcsv() to read the csv file, but it takes large amount of time. If u know any other method Please help me.

    Thanks

  2. #2
    SitePoint Wizard triexa's Avatar
    Join Date
    Dec 2002
    Location
    Canada
    Posts
    2,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've never worked with files that large, but there is also file_get_contents, file, and fopen.

    With fopen you could just fread it a bit at a time
    AskItOnline.com - Need answers? Ask it online.
    Create powerful online surveys with ease in minutes!
    Sign up for your FREE account today!
    Follow us on Twitter

  3. #3
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With such large files, you shouldn't load all data into memory at once.

    See this thread: http://www.sitepoint.com/forums/showthread.php?t=452031


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
  •