shane07 Posted January 12, 2010 Share Posted January 12, 2010 Hello I needed to import data from microsoft word document to mysql like what we normally do from excel to mysql. But different problem arises during reading the word file. e.g. unnecessary information from header information. I don't know how to strip those information. I could not explode the data in the format as I needed. As a reference my word file contains data in following format: Name1 Address1 Phone1 Name2 Address2 Phone2 and so on. Is there any way to import those data into mysql? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 12, 2010 Share Posted January 12, 2010 Your first step will be to export your Word document as a plain text file so that the content in it will be saved as plain ASCII text without all the underlying encoding being used in the file. The second best option would be to use the COM extension to let you open and process the Word document. This will require that you research and learn the Word commands necessary to locate and select text within the document. The worst option would be to attempt to read the raw .doc file and attempt to parse it yourself. Quote Link to comment Share on other sites More sharing options...
dgoosens Posted January 12, 2010 Share Posted January 12, 2010 hi, I guess you could save it as .txt and go through it line by line in PHP and save the data to a database... Filesystem Functions : http://uk.php.net/manual/en/ref.filesystem.php Quote Link to comment Share on other sites More sharing options...
dgoosens Posted January 12, 2010 Share Posted January 12, 2010 and another thought... phpLiveDocx: http://www.phplivedocx.org/ I think this allows you to work directly within your Word files... Quote Link to comment Share on other sites More sharing options...
shane07 Posted January 12, 2010 Author Share Posted January 12, 2010 thanx for your suggestions. Quote Link to comment 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.