My process scrapes a structured data table from a web page, but I want to remove all entries after a saved entry, is there a way to delete all data-table entries after a certain entry? Ergo if I have a data table with rows storing 1 -10 and I want to remove all entries after 7 is there a way to do this? I have a unique URL as the way to remove all entries after this, or even stop extract structured data table after that value is found?
Welcome to the UIpath Community.
After scraping data and use Write Range Activity to write into Excel file. And then use Read Range Activity to read the data from Excel and will give you output as dataTable. And from that find the index of that required row.
Then you can use Insert/Delete Rows Activity to delete specific no.of rows from Excel file.
Is that any more efficient then, say, just checking when to stop transferring things over in the for each row activity? Right now I get the data table and in the for each loop translate it into a html text file. I was wondering mainly if there was a more efficient way, ideally canceling the extract structured data early if you find an item, or just a remove data table row after a item. It’s a variable number of rows as well.
Hello Smith,
As you are reading the data from a web page using data scraping. In the data scrapping you can mention the no of records you want to read at a time in the bottom of the screen.
Hope it will work for you!
Hello @drew.smith you can try below
-
If you already have index of row after which data need to removed. Lets say it is 57…
dt.Select.Take(57).CopyToDataTable
-
If you have row after which data need to removed.
dt.Select.Take(dt.Rows.IndexOf(row)).CopyToDatatable
Let us know if you need further help with above mentioned solution.
Is there a way to do this variably, I won’t know ahead of time how many to look for, I have an item that is in the data table, not an index.