How to convert .txt file into MySQL

Good Day Everybody,

I’m am designing online store. My supplier is giving product information (images, product description, prices etc) in .txt file. The list is more than 9,000 long.

How can I convert this information into MySQL and retrieve data whenever user clicks product for purchase, since my online store will be a dynamic site.

I need to update the list almost daily as inventory from the supplier changes often.

I need distinguished forum members’ advice on this very basic question.

NOTE: I’m new to site design and development and Sitepoint’s books have been really helpful in guiding me thus far.

Best wishes,
Vijay
(vjmetal@gmail.com)

Something like this, maybe?

Thank you very much for the link. I appreciate your help.

Hi, astromax.

A couple of things you can look at:

PHP has a function called fgetcsv for importing CSV files, so you may be able to use that:
http://us2.php.net/fgetcsv

Alternatively, look into the mysql LOAD_DATA function:
http://dev.mysql.com/doc/refman/5.0/en/load-data.html

Regrads,
freezea.

Sounds like you have to update inventory feed from vendors daily.

Best approach is having a module that takes the data feed in text/csv or other possible formats and process it. Check out the file readers functions.

And be sure not to process all data at once. Add some sort of interval using threading. Otherwise you might overload the database if there is too much data.

Thank you to Freezea and Webcosmo for your pointers. It was very helpful.