How to rename if Same column name in excel

Hello everyone
i am facing a problem which is a excel file there are a same column name but not fix which will be same and i want to get a specific column name but i am not able to get i have used a code
str= read_dt.rows(0).item(“ABC”).tostring
i have got the value but in same sheet has two same column name with different value so i want to rename the column name or split _ to Space how to do this please give me solution

Thanks
Zaid Qazi

HI @zaid.ahmad

Check out this thread

Regards
Gokul

@Gokul001 hello
I can not uncheck header becouse column index is not fix

Have you check this thread? @zaid.ahmad

yes i have checked
but how to append new name to duplicate column

Hi @zaid.ahmad

You can use Write cell activity to add the new name as column header

@Gokul001 how to increament write cell value

You can do like this @zaid.ahmad

Regards
Gokul

Hi,

What do you mean?

The following is a sample to rename column name of datatable which is addheaders option off from contents of the first row. This might helps you.

Regards,

Hello @Yoichi Thanks for this
But still getting same error Actually I have downloaded the files from an application as a default folder after that i have moved it by condition wise in three folder after that i want to get each file name ,Sheet name and A specific column Value of only row(0) but not fix the column index and its successfully working but some files has same column name then i have got the error and i don’t have any idea which column will be same in that files so please help me how to make dynamically this solution
Regards
Zaid Qazi

Hi,

Can you share your worksheet as file? It’s no problem if dummy data, even if we can reproduce the issue.

Regards,

Copy of sample.xlsx (11.6 KB)
When i run it i have got this error “Assign: Exception has been thrown by the target of an invocation.”

Thanks

Hi,

In my environment, it works well even if input is your file.

image

Can you check the following sample?

Sample20201209-2v2.zip (22.8 KB)

Regards,

@Yoichi
Thanks you so much but when i checked header i have got the same error

Hi,

Does the above sample works in your environment?

Can you share screenshot of your expression and error message?

Regards,


When i open the my input file using excel application scope Its open the blanks workbooks and file name is right as a input file and got the error

@Yoichi hello
Can we give the condition in this sequence if column name same then do this And else continue the process so please make a conditional workflow because when a read perfect file without same column name then its not run comfortable

Hi,

For now, can you share your project which error occurs as zip file?

Regards,

Hii,
Zip file has no error but when i run the my sequence after one cycle it will be getting more than 10 min to read the file and file size is 30925 kb only but in this file has not any same column name.
how would be took the longs time to read the file?

Thanks

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