Delete the rows with particular values from excel/DT

Hello ,

I have a excel file - say - A.xlsx.
It has a column A -
I want to delete all those rows which has value - “zzz” for the column A.

I am able to open the excel file , then read range then save it to Data table
image

Please help

Thank you
Sonika

What did you already try until now?

2 Likes

Hi @Seem,
Here are the steps I have in mind:

  1. Read the excel file using Read Range activity.
  2. Create a variable that will store the row number (e.g. rowCounter).
  3. Use For Each Row to loop through the rows of the data table output of Read Range.
    3.1 If row(“A”) = “zzz”, Then use Insert/Delete Rows. In the activity, use the rowCounter variable in the Position property and set the ChangeMode to Remove.
    3.2 Increment rowCounter by 1 (Assign: rowCounter = rowCounter + 1)

…, uawd filter

  1. read and delete the entire range
  2. filter the datatable to exclude the ones that on column A have zzz
  3. write the datatable to the range

@c.ciprian

The filter dint work .
I had tried it…

I am having 3 conditions to be full filled.
I did 2 by using filter
this did not work

I want to delete all those rows which has a string value - Sponsered.

i really dont no what went wrong and why its not working

You might have space or other non printable character in your spreadsheet. Try with Contains “Sponsored”

3 Likes

Yes i have some spaces in the excel like — its like this

ther eis a space

Hi @Seem,

Try this,

2 Likes

@c.ciprian

I did the same , it dint work. :frowning:

I only need to make it work for one column.
distributor

Hi @Seem,

No Problem, you are doing good…!

Kindly refer to this xaml file for your reference… Hope would help you…!

Cheers…!Sequence.xaml (9.4 KB)
Book1.xlsx (14.9 KB)

1 Like

@c.ciprian

Its working fine.
If i use - Contains.

Thanks for the solutions

You’re welcome!

1 Like

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