chelnov63 Posted March 27, 2009 Share Posted March 27, 2009 Hi i have a 'business contacts' excel sheet which i need to import into my mysql database.. i know how to convert the excel sheet into a csv file and import it into a database fine..but for one problem... one of the fields in the excel sheet is a 'general notes' field. Now the notes in this field for example maybe in the format: 12/2/2008NDC Said to contact Joe Blogs, Marketing Comms Director who deals with agencies. 6/11/2007DMC Spoke to Joe Blogs, his PA. Not reviewing. 22/2/2007DMC Received mailer, but nothing coming up. OK to KiT. Send info on 27.11.06 especially including CRM/loyalty as he will have joined co then. Now if it wasnt for the general notes field, the exporting to a csv file is no problem (as all the other fields are just one liners)... but due to this the csv file gets completely messed up... does anyone know a solution to this problem? Thanks in advance.... Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted March 27, 2009 Share Posted March 27, 2009 Use an Excel reader library to read it directly as an XLS or XLSX rather than the extra step of converting to CSV Quote Link to comment Share on other sites More sharing options...
chelnov63 Posted March 27, 2009 Author Share Posted March 27, 2009 sorry mate..not sure i follow, havent done much importing before.. i have been supplied the information as an excel (.xls) file.. are you saying I can directly import it into mysql from the excel file, without using a .csv file? thank for your help mate!! Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted March 27, 2009 Share Posted March 27, 2009 sorry mate..not sure i follow, havent done much importing before.. i have been supplied the information as an excel (.xls) file.. are you saying I can directly import it into mysql from the excel file, without using a .csv file? thank for your help mate!! Correct. There are PHP libraries (such as the one listed in my signature) that have been developed to read directly from the excel file Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted March 27, 2009 Share Posted March 27, 2009 either a php library for reading excel, or if that's not an option, replace the linebreaks if it's going to be display in html you can replace with <br> $string=nl2br($string); Quote Link to comment Share on other sites More sharing options...
chelnov63 Posted March 27, 2009 Author Share Posted March 27, 2009 thanks guys ill check it out the libraries 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.