How to remove rows



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.



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.



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



p refers to each row of the datatable.



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”



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



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