Append excel does not support column name when we append data from data table


#1

column name does not appear while appending data in csv from data table


#2

Works as intended IMHO.

By definition if you’re appending DT to a CSV, there’s already data in it. Adding headers in the middle of the file would be bad.
For first write use WriteCSV, then for consecutive writes use append.

You can do it with an If:
if (File.Exists(yourPath)) { AppendCSV...} else { WriteCSV... }

It will also give you more granularity in possible error handling if you’ll need it later.


#3

?The prob while using write csv is i have to take certain records only inside a loop and write csv just overwrites the previous record so i was not getting any way to figure it out so i went for append excel


#4

You could create the file just with the headers before the loop.
Use Write Text File activity, as text pass
String.Join(";", yourDataTable.Columns.Cast(Of DataColumn).Select(Function(x) x.ColumnName))


#5

If you have created a data table, specify the exact names. Then upon output or during write range under properties check “Add Headers”. It will write the headers specified in the datatable. Not sure if this help resolute the issue.

Thanks!
-Arun