|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
export data to csv: escape new lines?
Hi,
I need to convert from mssqlto Postgres and I need to export all MS-SQL table data to a CSV or TXT file (one file per table) Presumably, all data per row (of a table) must be in one line. Then when you copy to another database, a new line of data means a new row in the table. However, MS SQL is exporting a large varchar text field as multiple lines. The data itself is many lines, so exporting it causes the data for one row to fall onto many lines. My question: How do I escape new lines? When MS SQL exports the data, I want to replace all NEW LINES / carriage returns by /n or by <br> tag (since the data will be for web use). (pls note I am not actually handling the ms sql database, so any response would be greatly appreciated as I advise the person in charge of the mssql db accordingly). Thanks a lot! |
|
#2
|
|||
|
|||
|
You can specify a text file as a target in DTS when performing a Transform Data Task or a Data Driven Query Task.
When the target text file is specified, clicking on the Properties button allows you to specify how the row is delimited. As you'll see from the attached screenshot, you can specify what that delimiter is. You can also amend how the data is delimited as well. Hope this helps. |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > export data to csv: escape new lines? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|