You left out a few details in your description like where are you wanting to output the data? For example, an existing spreadsheet or text file with data or new files.
Typically, if you have the input data saved somewhere like in a .txt or .csv, then you don’t need to use Copy to retrieve the data you want. Instead I would suggest using either Read Text file to a string or Read Range to a datatable.
To only take 500 lines at a time you can probably use the data as an array with .Take and .Skip
Let’s use a variable called ‘c’ that will be used to count how many times you take 500 lines.
‘data’ will be the variable with the information from the file we want to get.
Below are 2 samples of pseudocode to accomplish this
As a string with .txt, .CSV, or .XLS extension:
Read Text file
Write Text file => String.Join(System.Environment.Newline,data.Split(System.Environment.Newline(0)).Skip(c*500).Take((c+1)*500))
While c*500 < data.Split(System.Environment.Newline(0)).Count
As a datatable with .CSV, .XLS, or .xlsx extension:
Write Range => data.AsEnumerable.Select(Function(x) x).ToArray.Skip(c*500).Take((c+1)*500).CopyToDataTable
While c*500 < data.Rows.Count
So basically, it loops through and skips the last 500 lines and takes the next 500 lines (shown as .Skip().Take()) until you have hit the bottom of the data.
If you are wanting to output this data to an existing file, then you will need to add an additional Read Text file or Read Range in the loop so you can append your new data of 500 lines to it. There are a few ways to accomplish this as well. (Note: If desired, Set Clipboard can store your string to use Paste in a file)
Thank you. I hope this is helpful.