How to add Column names to read csv data table?

Hello, i have read csv file which has no column name how do I add column name to read csv data table?

Hi @kishore.shetty

whenever we read a csv there is an option called includecolumnnames in read csv activity properties, if that is enabled it will take the first cell in all columns as headers and create datatable with that as headers
or
if its disabled if will create a datatable with a default column name like column1, column2, column3, like that,

But if you want to assign new name rather you can do like this @kishore.shetty
myDataTable.Columns(0).ColumnName = “newColumnName”

so we cannot get a datatable on reading a csv using read csv file without a header for sure, isn’t it…

Cheers

1 Like

@Palaniyappan, ya I know about includecolumnnames option but there is no column name in csv file, i just wanted to add column name manually. What I’m currently doing is created a new data table with column names in row of that data table DT1 and csv in another data table DT2 and using write range twice once at A1 staring cell another A2 for DT2. Is there any other way without using two write range?

1 Like

@kishore.shetty

Did that work buddy
@kishore.shetty

Cheers

1 Like

@Palaniyappan sorry for late reply
yes it did work. thank you:)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.