Datatable headers

Hi,

I’m extracting data from a webpage table, but the headers are not recognized (there is more sensitive data below these lines). The first lines are what the headers are now, but the second line is what the headers should be. First three columns have no name, can be named column-0/1/2 no problem.

Is there a different way to fix this other than making the DT into a string and then “Generate Data Table” activity?

image

@JVDS After Data Extraction, when you use Write Range Activity, Can you uncheck Add headers and see if it works ?

@supermanPunch, yes then it works,thanks, I used ouput and write line before.
Does that mean it works with the datatable.Select function as well?
example dtOutput.Select(Module=‘something’) ?

@JVDS No. What I told you to do was a Process where you would have to read the File again to access the values based on the Actual headers. So after you have used Write Range with No Headers. You would have to read the File Again with Add Headers, in this way, the new datatable would have the actual headers that you need.

I didn’t understand what you meant entirely, but this function can be used to filter the datatable based on a criteria, but we would have to know the Proper Column Names for that.

1 Like

Your Datatable variable in UiPath still has the headers of Column-0, etc…

Your Datatable.Select would need to be dtOutput.Select(Column-1=‘something’).

Unless you write to an excel then re read the excel into a new datatable with headers

1 Like

@supermanPunch @TimK, yes that’s what I’m saying. So headers are equal to the column names right?

1 Like

@JVDS Yes. If you have read the file again with Add Headers checked then it Should have the Column Names that you need as the headers, However the Empty Column Names would have Column1, Column2, Column3, and so on.

1 Like

Great, thank you and @TimK for the clarification!

2 Likes

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