save .csv with newline character - TechRepublic
Question
November 17, 2008 at 01:11 PM
sanjeev.sircar

save .csv with newline character

by sanjeev.sircar . Updated 17 years, 8 months ago

i’m creating a .csv file on the fly, thus am enclosing all the data within double quotes.
how to put in a newline character is the problem. for eg:-
i tried the following –

“header1″,”header2″,”header3″\n”data1″,”data2″,”data3″\n”data11″,”data22″,”data33”

and

“header1″,”header2”,”header3 \n”\r\n “data1″,”data2”,”data3 \n”\r\n “data11″,”data22″,”data33”

so that the output looks like

header1 header2 header3
data1 data2 data3
data11 data22 data33

thanks a lot for your help

This discussion is locked

All Comments