I am trying to replace each row in Width column that has a value of - into 0. May I know the efficient solution where it can process thousand of rows quickly?
Kindly see picture below and the attached file for the sample file. Thank you.
Hi @RobertRussell_Monsalud
=> Use Read Range Workbook to read the Excel and store the Output in a variable say dt_data.
=> Use the below syntax in Assign activity:
dt_data = dt_data.AsEnumerable().Select(Function(row)
{
If row("Width").ToString() = "-",
Then
row("Width") = "0"
End If
Return row
}).CopyToDataTable
=> Use Write Range Workbook to write the data again back to excel.
Step 1: Use read range (preferable workbook activity) store the output in dt_sample .
Step 2: use Invoke code activity with in_argument as the datatable variable as shown below
Step 3:Add the following code in edit code:
In_Dt_Sample.AsEnumerable.ToList.ForEach(Sub(x)
If(x(“Width”).toString=“-”)
x(“Width”)=“0”
End If
End Sub
)