I want to export data from my MySQL database into a .csv file and then import the .csv file into Excel.
One of the fields in my database is a comments field where the users have included line breaks. When I currently export this into Excel using a .csv format I find that the comments field is split over many cells because of these linebreaks.
I have tried the REPLACE command on the query which calls up the data to be exported looking for CHR(10) & CHR(13) and replacing them with CHR(34). This results in an error message telling me that the database does not recognise the function CHR.
I have also tried replacing the linebreak with another character (a $), opening up the .csv file in Word, replacing the unwanted linebreaks in the comments field then replaceing my $ sign with a linebreak and then saving the .csv file and importing the new .csv into Excel. This works but it is too clumsy to expect users to do this themselves.
What I need is either a method of removing the unwanted linebreaks before I export the file or else a method by which I can use Excel to import the .csv in the correct format.
Can anyone help?