user3222101
user3222101

Reputation: 1330

How to avoid line breaks if content contains \n using ADF?

I have a ADF job which copies data from sql to csv but there is a column which contains free text and can contain tabs, new lines etc. When I run a job it breaks the column values at \n.

Is there any way to fix it?

enter image description here

Upvotes: 0

Views: 2306

Answers (1)

Martin Esteban Zurita
Martin Esteban Zurita

Reputation: 3209

I think you can use a SQL Server function in your query to eliminate all the \n in this field. Try a query like this for example, considering that [Field3] is the one troubling you:

select [Field1], [Field2], replace([Field3], '\n', ' ') as [Field3] from yourTable

This way, you are replacing all the \n with spaces and it won't break your csv data. Of course the replace is just an example, and your solution will depend on you specific use case.

Hope this helped!

Upvotes: 1

Related Questions