Rows need to delete for specific rows need to keep

Hi community,

I have an excel which having data of 1700 + so i just wanted the file need to keep first 10 rows and the rest need to be delete and write the file in write range, can you please help me on this.

image

Hi @chaitanyaKumar ,

Assuming you have read the Excel sheet data as a Datatable, then we could use the below expression :

UpdateDT = DT.AsEnumerable.Take(10).CopyToDatatable

Then, you would require to write the output in a new Excel sheet.

To Write it in the same sheet, you could clear the Sheet contents using Clear Range activity (Modern) or could follow the approach here :

Hello @chaitanyaKumar

dt.asenumerable.take(9).copytodatatable

1 Like

Hi @chaitanyaKumar

Try this:
dtData.AsEnumerable().Take(10).CopyToDataTable()

Hi Arpan,

Actually the flow will copy in the data table from the table it will write in excel using write Range activity. here it will paste whole 1700+ records. now i need to take the file from which 1700+ record and take only first 10 values and rest things need to delete and write into one more write range which i can process the next step with the 10 transactions.

Regards,
Chaitanya

Hi @chaitanyaKumar ,

Just to understand your requirement, You have 1700+ rows of data in DT, In that you want get only 10 rows of data that’s needs to be pasted in another sheet and rest of 1690 you don’t want, I am I correct?

yes exactly just for testing i need 10. after that we need to run whole 1700+.

just for testing i need to delete the data.

Hope this will help you

image
BlankProcess15.zip (9.8 KB)

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