Excel datatable select issue

Hi,

I am currently automating excel using studio and I have stored my worksheet in datatable dt1. now i want to select each row from dt1 using dt1.select to copy it into another datatable . Main issue here is i dont have column name/headers so dt.select(“col name=‘abc’”) is failing plus my rows are also dynamic so if abc is in row 3 then it could be in row 45 next time. Any idea how to do it?

If you want a new datatable with select rows, you could try using the Filter DataTable activity. - it let’s you use column name or column index, so headers are not required.

If the columns are dynamic, I would recommend having them named at its source. If not, you would need to identify the type of data in each column so you can name the columns before executing any datatable manipulation.

Although, your approach will depend on what and how you are processing your data.

Hi Clayton,

Thanks for quick reply and solution.
will try & let you know.

Hi,

I think its better to add headers in the source file. otherwise solution will become quite complex.
Thanks for the help!

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