Hi all!
I’m importing some excels in a loop. The excels are supposed to have the exact same headings but sometimes there are four initial columns (A to D) that shouldnt be there - these four columns always have the same headings. After columnd D the excel is as it should be.
I would like to do a check the data table something like this:
IF (Column A = “Heading1” and Column B = “Heading2” and Column C = “Heading3” and Column D = “Heading4”)
Then remove column A, B, C, and D
Else exit;
This is the current loop:
use the below code in the if condition DataTableName.Columns.Contains("YourColumnName")
if returns true
use Delete Column activity to delete the column from the data table.
do the same thing for rest of other columns
so for this purpose use read range activity to get the datatable.
after that check in if condition delete the column. then use write range activity to write the data into excel file.
Thanks for your help. I use a “Read Range” activity but when I want to use the “Delete Columns” activity it requires a “Table Name”. See screen shot attached.