I have a string that is mostly just a long set of numbers separated by whitespace and newlines.
I want to parse this string out such that I could take each individual number and add it to a table (or tables) as its own item; or assign each individual number its own variable.
Example string to parse:
10 5
65535
0 0 1 2 3 4
5 6 7 8 0 1
2 3 4 5 6 7
8 11 1 2 3 4
5 6 7 8 11 22
0 1 2 3 4 5
6 7 8 11 0 0
1 2 3 4 5 6
7 8
You can’t see it by looking at the string, but this is actually a 10 by 5 heightmap that describes a gentle slope capped by a very sharp spike.
note: heightmaps are not the only reason I want to be able to do this: they just make a good use case for my situation.
Speed is not an issue; this is a plugin I am building to run in Studio. Any solution that can take less then half a second to parse a number is acceptable to my eyes, even if the total run time in the worst case scenarios equals two hours or more.