Not pasting data into website

I am trying to take the first 30,000 rows only in Column A and paste into a website. Then take the next 30,000 or less rows in column A and paste into the website again. This is what i have so far but I am not successful in it copying any data to paste. (i am a beginner)



3

(i used a filtered data table because I only want to copy the first column of data and not the other columns. There are 34,000 rows in the first column so i need to copy the first 30,000 and paste and then go back and take the remaining amount and paste that dynamically b/c the count will vary.

rowCount = dtData.Rows.Count
dtBatch= dtData.AsEnumerable.Take(30000).CopyToDatatable
dtData = dtData.AsEnumerable.Skip(30000).CopyToDataTable

rowCount = dtData.Rows.Count

Hi @Laura2 ,

Could you maybe take a look at the below post. It has a Linq Implementation on Segmenting the Datatable based on Segment Size (For your case 30000). You will get the Output as list of Datatables each with the 30000 rows.

Also, Once you have read the Excel sheet, you can keep the remaining activities outside the Excel application Scope, Just to keep the Excel scope related activities separate.

Let us know if you were able to understand and implement the approach.

@Laura2

Basically inside your for loop you are sending key shift+f12 but the value is not being sent…

Manually how do you paste the value?

And do you need to paste all the roes at once into the field?

If yes then use set to clipboard activity and assign the complete data to clipboard String.Join(Environment.Newline,dtbatch.AsEnumerable.Select(function(x) x(0).ToString)) this will join whole of the column with newlines and convert it into string and assign to clipboard

Now you can use ctrl+v to paste the data from clipboard to the field you need

Cheers

Thank you! that works. I am having an issue with it copying all the data again and not skipping the rows that was already posted to the clipboard. Do you think I have the assign activity (dtData = dtData.AsNumerable.Skip(30000).CopyToDataTable in the wrong location?

@Laura2

Yes…may be use it immediately after take…so that it skips…for next iteration if used in loop

Make sure data is not read again else the rows would come back

Cheers

Ah ok thank you so much!

1 Like

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