SchweppesAle Posted January 16, 2010 Share Posted January 16, 2010 hi, I'm trying to slowly insert data via a csv file(50mb). In order to do it, I figured that I would parse every few rows of data using file_get_contents and (maybe) preg_match_all. Is there anyway to accomplish this? Link to comment https://forums.phpfreaks.com/topic/188653-parsing-huge-csv-file/ Share on other sites More sharing options...
SchweppesAle Posted January 16, 2010 Author Share Posted January 16, 2010 wait, maybe I can use a while statement and iterate through every character? I'm using line breaks though "\n" when a match is found that's the length? Link to comment https://forums.phpfreaks.com/topic/188653-parsing-huge-csv-file/#findComment-995958 Share on other sites More sharing options...
JAY6390 Posted January 16, 2010 Share Posted January 16, 2010 use fopen() and fgetcsv() instead. Loading a huge file of data into memory is highly discouraged Link to comment https://forums.phpfreaks.com/topic/188653-parsing-huge-csv-file/#findComment-995960 Share on other sites More sharing options...
SchweppesAle Posted January 16, 2010 Author Share Posted January 16, 2010 use fopen() and fgetcsv() instead. Loading a huge file of data into memory is highly discouraged agreed, I actually tried fgetcsv however I need to somehow cut the csv into pieces or we run out of memory. Loading the file through MySQL won't work since I need to manipulate the data before entry. Link to comment https://forums.phpfreaks.com/topic/188653-parsing-huge-csv-file/#findComment-995965 Share on other sites More sharing options...
SchweppesAle Posted January 16, 2010 Author Share Posted January 16, 2010 man, this is totally not going to work Link to comment https://forums.phpfreaks.com/topic/188653-parsing-huge-csv-file/#findComment-995974 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.