How to find a particular row in data scrapping

I got some unstructured data which dont have any headers by using data scrapping. I want to find a particular data after a row in the scrapped data.
For example: I have 200 lines of scrapped data. I want data after 160th row, so result would be 161 to 200 lines.

Thanks in advance

Can you let us know if you are getting any particular key word after that line which you want to split the data or How are you trying to know at which particular line you want to get the data @mani93?

No its dynamic data. In some cases im getting the same key in multiple lines

Or do you want to split at a particular line of text? Please explain how you want to split the data, then it will be easy to understand and give you the idea how to achieve that :slight_smile:

i find a way to get my required output. but everytime i need to delete headers and first 10 lines. can you help me out how to clear the headers and delete first 10 lines from a data table

@mani93

You can use Insert/Delete Rows activity to delete rows from excel file.

If you want to skip first 10 rows and read remaining rows then you can try below expression.

 dataTable.AsEnumerable.Skip(10).Take(dataTable.Rows.Count-10).CopyToDataTable()
1 Like

I hope the text is stored in a variable till now :smiley: @mani93 . Thats why I used the word split in both the posts above

So, you can delete the first ten rows of the data table using the below steps

Use a While activity:

  1. Create variable count and assign the value 1
  2. Condition for while count < 10
  3. use Remove Data Row and set RowIndex to 0
  4. Increment the value of count by 1

This will remove all top 10 rows from the datatable.

@mani93

I did the same thing to delete the rows. here one more challenge is to remove the headers. one way of removing headers is to store the data in excel and then by using readrange activity to fetch the details while pasting the output i can uncheck the Add header box. but i dont want to perform above step. i am looking for other alternative.

@lakshman I have the data in data table. i want to delete it directly from there. i dont want to paste that in excel and again fetching and doing the process which told is a bit lengthly. And i want to remove the headers as well directly from data table.

Sorry, there is no datatable without a header, it is just not technically possible…

1 Like

Hi
Even though you neglect add headers default column names like column1, column2 will get created for a datatable
So there is no datatable without headers

May I know why you want to avoid headers
Cheers @mani93

@Palaniyappan I am scrapping an unstructured data. so the header which iam getting is looking like 20- 25 lines of data which makes the excel soo bad.