Remove particular Data columns by using Wildcards

Hi @he.cao
u can try this way

Read the excel file and store in dt1

now use below assign activity to get only column name starting with Column-

data_array = (From dc In dt.Columns.Cast(Of DataColumn)
Where dc.ColumnName.StartsWith(“Column-”)
Select dc.ColumnName).ToArray()

Now use for each loop to loop through each element in data_array [ datatype of data_array is String ]

Iniside the loop use Remove Data Column Activity to remove the column from the datacolumn by specifying the name of column

Regards,
Nived N
Happy Automation

1 Like