text having newlines not downloading perfectly in csv file

Viewed 50

I have data in a database that needs to be exported to CSV. Some of the fields include newlines which MUST be preserved.I am using sed to export data and it is being exported like this (this is sample data of course):

38,"testing 
here"

in csv file after download it is showing as:

csv file output

but it should download like:

expected output

Following command using to download csv file:

mysql -r -u*** -p*** -P*** -h****   databaseName -e 'call procedurename (0,38,10)' | sed 's/\t/,/g' > /sample.csv

Is it possible to export newlines in CSV files? Please help me out.

Thanks in advance.

0 Answers
Related