Identifying first/last occurrence and making flexible dimension waves
Sat, 09/04/2021 - 02:24 pm
These probably have trivial solutions but I'd be thankful if you could please help me get to them..
1. I have a 1D text wave that has let's say 300 rows. Now strings in some cells are repeated and these might not be continuous, i.e. any random indices of rows may contain the same string value. What I want to do is to identify the index of the first occurrence and the last occurrence of any particular string. I was going the messy route of running a for loop, identifying the indices where a string value occurs, storing them in a temp 1D wave, and then picking the maximum and minimum from the temp wave. However, I'm sure there must be a much more elegant way to do this. Kindly advise.
2. How can I make a 1D or 2D wave that has flexible dimensions? For example, I am running some calculations and the results have to load into a new 1D or 2D results wave. However, I don't know yet what would be the size of the results wave and I can't anticipate it either. So instead of predefining the dimensions, is there a way to use the make syntax that allows for producing waves that grow in size as values get loaded into them until the final value is loaded?
Thanks a ton in advance for all your help!