1

In a dataset, I can see that I can add dynamic content in the First Row as Header box:

enter image description here

My question is can I use dynamic content in a way that if a column header is empty in the csv then I can add a custom name. If all the column names are there, it would take the first row as is?

Asking because I have some files with 1/2 empty column names.

Thanks!

1 Answer 1

2

My question is can I use dynamic content in a way that if a column header is empty in the csv then I can add a custom name. If all the column names are there, it would take the first row as is?

No,because dynamic content must return boolean value,you can't replace empty column name with your custom name.

As a workaround,you can use data flow.

Below is my test sample:

My data in csv file:

fieldA,,fieldB,,fieldC
1,2,3,4,5

Setting of source of dataset:

enter image description here

ADF will auto generate column name when your column name is empty,like _c1

enter image description here

Then you can use DerivedColumn:

enter image description here

Finally:you can use select or sink mapping,delete columns which are generated by ADF.

Sign up to request clarification or add additional context in comments.

1 Comment

using a data flow instead of copy activity worked. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.