How to remove rows

uiautomation
activities
studio

#1

hello to the whole community.
everything good?
I would like to ask you for help in resolving my doubt.
The picture below shows a part of a large table. My goal is to delete all the lines containing the phrase “Grand Total”; How can I do it?

PS: The index of the line always varies, so it is not possible to rely on it.


#2

@momi_fede

Read the Excel sheet and store it in a datatable dta

Create one more datatable variable dtb

dtb= (From p In dta.Select
        where not  p.ItemArray.ToList>Contains("Grand Total")
       Select p).ToArray.CopyToDataTable

Now use WriteRange Activity to Write dtb in Excel. It will not contain the rows which is having GrandTotal.

Regards,
Mahesh


#3

thanks for your help!! but can i know, what the “p” refers to?


#4

@momi_fede

p refers to each row of the datatable.

Regards,
Mahesh


#5

ah I understand, thanks again for the help.
I ask you one last thing … as I would like to eliminate such righa I used “Remove Data Row” activity. But I have the problem that as input the activity requires me a variable of type “Data Row” how can I convert a variable of type “Data Table” to “Data Row”


#6

@momi_fede

You cant convert Datatable to datarow, because Datatable is a collection of Datarows.

Regards,
Mahesh


#7

eh ma io ho bisogno di eliminare semplicemente la riga senza ricopiarlo in un altro file excel