How do I insert line breaks in a text file that is opened in a browser.
Posted on 2009-02-24
I am sure that this is a simple problem for the experts but I am really battling with this. I work on a web based system where clients can view time series data in certain formats, e.g. as a graph, table, csv, etc. When they select the csv format a file download dialog appears that asks if they want to open or save the file.
I also have to serve up the data in a specific text file format, say *.dhf. When the user selects this format the same file download dialog appears that asks if they want to open or save the file. When they choose to open the file it is opened in notepad - which is correct!!
My problem is that I can not get the line breaks between the lines of data in the file. I build the file in php and I have tried "\r\n", "#13#10", "&#13;", "
" but nothing seems to work. Please help.