How to get 10 records at a time in a txt or xlsx list
Hello, how do I get 10 records at a time from a txt list or an excel column to perform a search in a desktop software form?
The software only allows you to search 10 records at a time, I need to search to the end of this list every day.
With this assign, you can get your first 10 row of txt file.
arrFirstTenRow = Split(strText,Environment.NewLine).Take(10)
If you want to write side by side, you can use this assign after above.
hi What am I doing wrong?
You don’t get 10 at a time. You read the whole thing into a datatable, then manage the “10 at a time” part as you perform the steps you need to perform with the data.
I’m trying this way but it’s still with an error there’s an example I can base myself on
I’m really not sure what you’re trying to do there.
Use Generate Datatable to turn the text into a datatable.
what I’m trying to do is an automation that will read a txt file and select 10 lines at a time to perform a search on a system until it finishes all the lines of the file
My difficulty is to select 10 records at a time to do the search
So, if I understand correctly, you need help building an algorithm that fits your needs.
Read the text file
Split it into an array using String.Split you may use
VbCrLf as the separator Count your items
set an int32 variable as your index starting at 0
Use a while loop
Use another loop from index to index +9
Increment your index by 10, be careful not to go out of your array bounds
Here is an activity called “Read Specific” that can read only specific line.
I have developed a package to make easy the text file format utilities.
It is a package to handle the automation for Txt,Csv,Xml ,Json and TextFormat File
This package has many activities to handle the text format files like Txt,Csv,Xml ,Json and TextFormat File. The activities are to handle insert,update,delete and other operation.
TextScope - It is a scope activity.It keeps only the file path. It doesn’t keep the text file resource.
DeleteAt - Delete the line at specific line
We can’t use non-UiPath packages, but yes BalaReva has a lot of useful activities.