Remove row (index -1) if row contain

Hi everyone !

I need some help. I have a data table with several rows. My request :


The picture is a text file but my work is on a data table of course.

i have several blocs like that. For each bloc :

If the bloc contain “DLIV” and the the next rows contain “V1105” then remove all the rows even the last line (visible with the “5”).

I already do the if for remove the rows which contain “V1105” :


  • add to collection
  • remove

I need to add the elements for remove the row before the bloc (“1000”)and the row after the bloc (“5”).

How can i do that ? Thanks for your help :slight_smile:

Hi @BaptisteC

try to use filter data table activity.

Thanks for your reply @kalyanDev

How can i do in the filter data table activity for specify that i want to remove all the line which contain V1105 and contain “DLIV” in the row before the bloc. And if the “if activity” is correct, remove also the row who contain “5”.

I specify that several bloc can have the code “DLIV” but every bloc can have the duo “DLIV” + “V1105”.

Thank you.

can you please send the sample excel file.if possible. and i am not getting what is bloc and what is 5

Kindly elaborate the condition on which rows to be removed based on what value
sorry i couldnt get the condition to be made with this description
may be a example could help us

Cheers @BaptisteC

Hello again, @kalyanDev @Palaniyappan

A sample excel file :
Forum UiPath.xlsx (9.0 KB)

This is a bloc :

A bloc begin always with “1000” → F0 B7 1000
And finish with “5” → M2 B7 5
I have 3 blocs in this sample.

I have a excel input like that :
Input.xlsx (8.4 KB)

This file represente the line that i have to treat in the first excel file (Forum UiPath). DL - IV - 41087 for example. I have to remove all the bloc.

We found this informations here : 1000 140819FRT3ORDLIV (C1 in excel) and C3-4-5-6-… for “41087”.

I need to do a first research : DLIV to know each bloc have it (because several bloc can have DLIV. The 3 blocs in the sample have DLIV).
A second research to know each bloc which have DLIV, have the number 41087.
And after that, remove the bloc which have the duo DLIV and 41087. All the bloc (example of a bloc above).

I expect that i’m clear :stuck_out_tongue:
Thank you for your help.