naskoo Posted October 12, 2009 Share Posted October 12, 2009 Hi, I need to load a *.csv file in a bzip2 archive from a remote server to my database. Is there any option to decompress the archive and read the data from the csv file just with mysql. Something like: LOAD DATA LOCAL INFILE 'http://example.com/Destinations.csv.bz2' INTO TABLE `csv_test` FIELDS TERMINATED BY ';' LINES TERMINATED BY '\n' Or I need to decompress the bz2 to temp *.csv, read the *.csv and add the data to the DB. Thanks in advance! Regards Nasko Quote Link to comment https://forums.phpfreaks.com/topic/177424-solved-somefilecsvbz2-to-db-help/ Share on other sites More sharing options...
markwillis82 Posted October 12, 2009 Share Posted October 12, 2009 decompressing the csv would be the easiest way as mysql wouldn't be able to handle the decompression. you could then wrap the whole process in a BASH/DOS script Quote Link to comment https://forums.phpfreaks.com/topic/177424-solved-somefilecsvbz2-to-db-help/#findComment-935653 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.