Will this string always (or usually) be in this predictable format of simply numbers? If so, I suggest using “string.match()” and “string.gmatch()” and setting up the proper pattern iterator. Actually, you could do it even if the string “table items” were non-numeric, but you’d have to include other character types in the string matching iterator as well.
My recommendation would be to start with JSON as the data format, which isn’t terribly different. But you can also run a quick file creator. Go ahead and create the table in Lua:
local list = { 1, 2, 3, 4 }
use loadSave and save list out at which point you will have a json table. Then you can use loadSave to read it and turn it back into a table. As it is now, you would need to read the file in and parse the data yourself.
Will this string always (or usually) be in this predictable format of simply numbers? If so, I suggest using “string.match()” and “string.gmatch()” and setting up the proper pattern iterator. Actually, you could do it even if the string “table items” were non-numeric, but you’d have to include other character types in the string matching iterator as well.
My recommendation would be to start with JSON as the data format, which isn’t terribly different. But you can also run a quick file creator. Go ahead and create the table in Lua:
local list = { 1, 2, 3, 4 }
use loadSave and save list out at which point you will have a json table. Then you can use loadSave to read it and turn it back into a table. As it is now, you would need to read the file in and parse the data yourself.