Hi Everyone,
I have to replace data yes to pending but
Sone specific columns
Ex column1 column2 column3 column4. column5
Column3 to columns5
Thanks
Hi Everyone,
I have to replace data yes to pending but
Sone specific columns
Ex column1 column2 column3 column4. column5
Column3 to columns5
Thanks
Steps to Replace “Yes” with “Pending” in Specific Columns:
Read the Excel file using the “Read Range” activity (Store in dtData
).
Loop through each row using “For Each Row” activity.
Modify values in specific columns (Column3
to Column5
).
If row(“Column3”).ToString.Trim.ToLower = “yes” Then
row(“Column3”) = “Pending”
End If
If row(“Column4”).ToString.Trim.ToLower = “yes” Then
row(“Column4”) = “Pending”
End If
If row(“Column5”).ToString.Trim.ToLower = “yes” Then
row(“Column5”) = “Pending”
End If
Write back to Excel using “Write Range”.
You can use the below LINQ Expression to replace the yes with pending in specified 3 column,
- Assign -> dt_Output = (From row In dt_Input.AsEnumerable
Let Column3Value = If(row("Column3").toString.tolower.equals("yes"), "pending", row("Column3").ToString)
Let Column4Value = If(row("Column4").toString.tolower.equals("yes"), "pending", row("Column4").ToString)
Let Column5Value = If(row("Column5").toString.tolower.equals("yes"), "pending", row("Column5").ToString)
Select dt_Input.Clone.Rows.Add(row("Column1"), row("Column2"), Column3Value,Column4Value, Column5Value)
).Copytodatatable()
Note: Change the column names based on your input data.
Hope it helps!!
please elaborate the ask or show some input and output template
else let us know what you tried and if you are facing any issue
cheers
Thank you everyone
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.