Hi everyone,
I need to filter a datatable by its columns names.
Only columns that contain “NETPR” in the column name should remain. The other columns should be deleted. Anyone know how can I do that?
Hi everyone,
I need to filter a datatable by its columns names.
Only columns that contain “NETPR” in the column name should remain. The other columns should be deleted. Anyone know how can I do that?
Use Read Range activity to read the data from excel file and store output in inputDT.
And then try below expression to filter the data from given DataTable.
filterDT = inputDT.Select("ColumnName = 'NETPR'").CopyToDataTable
And then use Write Range activity to write into Excel file and delete existing sheet.
Hello @mazlumkacar,
You can do something similar to below image: (Please change DataType for “item” variable.
Thanks a lot @Bhavik_Solanki. But should i create a variable named “ColumnName” for this process?
Because i have no a spesific column name in this process. I need to remove those columns by its name.
@mazlumkacar , No you don’t have to. It is in-build property of DataColumn. As I mentioned in my previous post don’t forget to change the DataType of the “item” variable.
Thanks again @Bhavik_Solanki . But i am getting this error when i try to do this.
@mazlumkacar
Sorry for the late response. There is minor correction in above workflow. in For Each Activity, just replace “dt_httpresult.Columns” with “dt_httpresult.Copy.Columns” and it should work.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.