Delete column by condition

Hello,

Because header col dynamic so i can’t delete by name col
Can I delete column by condition: have value: x, Φ, OD…

Yes, you can delete a column by condition using UiPath. Here’s an example of how to do it:

  1. Use the “Read Range” activity to read the data from your Excel or CSV file into a DataTable variable.
  2. Use a “For Each” activity to loop through each column in the DataTable.
  3. Inside the “For Each” loop, use an “If” activity to check if the column contains the value you want to delete.
  4. If the column does contain the value, use the “Remove Data Column” activity to delete the column from the DataTable.
  5. Once you have looped through all the columns, use the “Write Range” activity to write the updated DataTable back to your Excel or CSV file.

Hi @Nitya1

  1. How can I use list for content want delete
  2. After run it deleted col but not correct (deleted col5)
    image

Hey @anh.nguyen ,
Check this workflow

DeleteColumnByCondition.zip (2.3 KB)

Regards,

6 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.