HOW TO DELETE UNWANTED ROWS FROM SOURCE DATA TABLE

Hi every one,
i need to select only tow rows and delete remaining rows and update in same data table

This is my input
IN

Expected output:
OUT

i need this updated output in same sheet

You can use an assign function with the below input:

yourDT = yourDT.asEnumerable.take(2).copyToDataTable

Thank you . But this will not delete my remaining rows in source data table

@adarsh_kotagiri

Use Delete Range activity and mention Range as “A4:D6” to delete remaining rows except top 2 rows.

Ah sorry, I thought you were talking about removing rows from the DataTable object, not the excel file itself.

Adarsh Kotagiri’s response accomplishes that

It will take only the first two rows from the datatable, and assign that to the existing datatable object, effectively deleting remaining rows.

you can use the origin rows count and filling up the datatble with empty rows after extracting the top x rows as an alternate

thank you every one…

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