01-16-2013 07:49 AM - edited 01-16-2013 07:49 AM
Hello
I have large string like this:
TITLE
n1
string1-1
string1-2
string1-3
n2
string2-1
string2-2
string2-3
n3
string3-1
string3-2
string3-3
...
n99
string99-1
string99-2
string99-3
And I want to create array:
n1 string1-1 string1-2 string1-3
n2 string2-1 string2-2 string2-3
...
I have tried using Spreadsheet to Array but haw to define delimiter
Any Suggestions?
Solved! Go to Solution.
01-16-2013 08:07 AM
Assuming that all the lines end in the same delimiter, there will be a two-step process. First convert it into a 1D array using the line delimiter and then reshape the 1D array into a 2D array.
Mike...
01-16-2013 08:09 AM
You can convert the String to a 1D Array and then reshape that to get a 2D Array. If you are sure about the number of elements thats is going to proceed after n then try this method.
01-16-2013 08:19 AM - edited 01-16-2013 08:22 AM
thanks,
but can I define that all n1, n2 ... n99 will be considered as delimitters?
Making some regular expression like n[0-9]+\n ?
01-16-2013 08:25 AM
Not with the spreadsheet string to array function. For that you would need to parse the string in a loop first on the "n" values and then parse each segment thus found into a 1D array using the line delimiter. Combining all these 1D arrays will give you a 2D array.
Use the match pattern function for the initial segmentation.
Mike...