Just what is a list? It is nothing more than a grouping of items.
It can be a list of colors, foods, places or even people but whatever the items are they only make up one list. If there are multiple items per line then that constitutes a table. While that is an okay way to for data groupings for this example we will stick to a simple list.
Look at this list.
This is a very simple list. Notice how each makes up just one line. When we process lists in UBot Studio the capability is there to load the first item and process it. And continuing on we can ultimately process all of the items in the list.
The purpose of this article is to describe the correct way to “Save” the list to a file.
Often times people start building their list from inside a Loop, which is a great way. What they do not understand at this point is that the “add to list” is a powerful node and has all of the repetitiveness built inside of it. Meaning, if the choose by attribute is set up correctly then “add to list” only needs to be executed once.
The only time “add to list” needs to be executed multiple times is if different web pages are needed to load in order to get to more data. This is acceptable as well because this node will append the new data to the existing list.
Adding this one node “add to file” will save that list to its own file. In a similar manner, “add to file” has the ability to save the entire list to the designated file. This means there is no looping required to write the items individually. The whole operation is clean and efficient.
Typically, this is one of the last nodes that will be added after a list building process unless of course it is not needed and it will be processed.
But if you do save your list, now you can review it outside of the UBot Studio environment or can re-use it in another application.
Here is a Bonus Tip. As you are building a list just know that it is consuming memory. If you are a techno geek then you will see memory consumption rise. So the bigger the list then the more memory will be used. If you are building a large application then you may want to consider releasing memory you no longer need such as your temporary list. Just issue a “clear list” and you will see your memory foot print go down.