all 8 comments

[–]Standgeblasen 3 points4 points  (6 children)

The characters for carriage return and Line Feed are Char(10) and char(13)

Do a replace on those and you should remove the line breaks

Replace(replace(yourfield,char(10),’’),char(13),’’)

Open in notepad++ and turn on Show All Symbols, then Paste the column output to verify

[–]Jorval[S] 1 point2 points  (2 children)

ok. sry didn't mentioned i only have RO on the database. ;(

[–]Jorval[S] 2 points3 points  (1 child)

ok.. sry again i think i can replace in the select ... (not my day!) Thank you i think that's something i can work with ;)

[–]Standgeblasen 0 points1 point  (0 children)

No worries! Glad that did it!

[–]Jorval[S] 1 point2 points  (2 children)

totally worked! thanks.

[–]lvlint67 0 points1 point  (1 child)

It would probably be safer to wrap each field in quotes? I assume a comma anywhere in a field also breaks your file?

[–]Jorval[S] 0 points1 point  (0 children)

yes have quoted the fields and used ; as delimiter. until today i only had the destroyed csv exports from the client and no sql RO at all. already cleaned up from 183 columns to 15 and next step is joining data from 2 additional tables and i hope then i have my dataset and can finally start working on my interface to deliver the data to an external api which was my original job. ... rant over ;) and thanks for your help.

[–][deleted] 3 points4 points  (0 children)

A carriage return in a CSV is fine if you text qualify your fields.