Hello,
When I read an Excel file that I can only download in CSV format using the “read csv” activity, I cannot convert it to a datatable due to duplicate columns. How can I solve this issue?
Hello,
When I read an Excel file that I can only download in CSV format using the “read csv” activity, I cannot convert it to a datatable due to duplicate columns. How can I solve this issue?
Hi @erimbetul
You can read the CSV file by unchecking the Add Headers
option in Read CSV activity.
Regards
yes but i need that column names after this step how can i make the first row as column headers again?
you can loop through the columnd dt.Columns
and then inside loop use if condition to check if already the same column name exists…if no use currentitem.Columnname = dt.Rows(0)(currentitem.Columnname).ToString
…on yes side use currentitem.Columnname = dt.Rows(0)(currentitem.Columnname).ToString + "_1"
I hope only one duplicate if multiple can handle accordingly
cheers
Hey @erimbetul Instead of using read csv can you use Excel application Scope and inside use Read range activity and uncheck the header option this way you can also read that file.
might be it not showing file when you try to select file using the excel application scope insted copy that file path and paste in the excel application scope then use read range
cheers
Hi @erimbetul
Unselect the add headers option in read CSV activity properties. Then make the first row of datatable as columns.
Check the below thread to make first row as columns of a datatable,
Hope it helps!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.