Hi,
i have a Excel Data in that sheet having many columns is there. so that i want to remove value on Selective column Name.
Input Data:
Expected Output
Thanks
Shyam
Hi,
i have a Excel Data in that sheet having many columns is there. so that i want to remove value on Selective column Name.
Input Data:
Expected Output
Thanks
Shyam
Hi @Shyam_Pragash
If you want to directly remove columns of the sheet, can you try Insert/Remove columns activity?
if you want to delete columns by name
kindly refer this link
Thanks
Hi @Shyam_Pragash,
You can delete a column and recreate the same column, so all the value are empty.
Else
use for each row activity loop it
using Assign Activity
row("Col2")=string.empty
Regards,
Arivu
use invoke code activity with this
dt.AsEnumerable().ToList().ForEach(Sub(row) row("Col2")="")
dt.AsEnumerable().ToList().ForEach(Sub(row) row("Col4")="")
invoke code arguments:
use this for reference
TestA.xaml (8.7 KB)
@Shyam_Pragash
if you want to make it dynamic, you can add 1 more variable “columnsToEmpty” then split by comma to an array and iterate over this array
TestA.xaml (10.0 KB)
Hi @Shyam_Pragash ,
Maybe this is an Alternate Solution, where we deal with only the Columns, instead of Updating the all row values of that Column :
columnNamesArray = DT.Columns.Cast(Of DataColumn).Select(Function(x)x.ColumnName.ToString.Trim).ToArray
Assign
ActivitycolumnsToRemoveValues = {"Quotation Ref"}
Then, we Remove the Columns specified in columnsToRemoveValues
from the DT
and we add them again and Order the Columns using Assign
Activity. The Ordering is as of the Original DT Columns.
Next, we write the Datatable back to the Excel Sheet using Write Range
Activity.
Find the Example workflow Below :
Delete_ColumnValues.zip (10.3 KB)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.