Jump to content

large file and ftell, fseek problems


the_ut_tick

Recommended Posts

Hi,

 

  I have an extremely large text file (9GB) of data that I am trying to get into MySQL.  I have a php code that opens the file, reads in the data line by line and stores each line in the appropriate database.  The problem is that the server that I am using won't allow the file to be opened for more than 30 seconds.  To get around this, I started doing a ftell after each line write and then when the program is rerun, that position is read from another text file and an fseek goes to that point to start again.  The problem that I have is that occasionally, the ftell seems to return a 0 and the program starts from the begining. 

 

  Am I overlooking something, or should I go another route?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/43829-large-file-and-ftell-fseek-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.