Replacing \r\n

C

Chris

I'm trying to export data from a MySQL database to an Excel file using
PHP. In one of the fields from the database I have a large text field
that does contain some "\r\n" sequences where a user entered a newline
(in an HTML textarea input box for example). When I export these to
Excel they appear as new rows for each line break in the text field.
I've tried replacing them with just a "\r" or just a "\n" but they
continue to show up. What can I replace it with so that Excell prints
the sequence as a soft-break within the cell (akin to typing ALT-Enter
in Excell)?

Thanks!

Regards,
Chris
 
P

Peo Sjoblom

In the replace with box hold down alt and type 010 on the numpad, the
release the alt key
 
C

Chris

I have to replace the characters on the fly - My PHP scripts are
creating the excel spreadsheet based on data output from MySQL. I've
tried using chr(10) to output the equivalent of ALT-010, but that
didn't work. I need to know how Excel stores the soft returns. It's
not as a \r (carriage return) nor is it a \n (new line).
 
R

rossf

Chris

Did you ever manage to find a solution to this issue (\r\n to Excel)?

Many thanks
Ros
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top