The problem is that the length of your patter is not fixed. If it were fixed a calculation could be easily created, but to handle the variable length of up to 100 elements, you'd need a recursive custom function to "loop" through the items of your list. That, in turn, requires Filemaker Advanced in order to define and install such a function in a Filemaker file.
Do you have filemaker advanced?
I do have FM Advanced version 12. You describe exactly the problem I want to address. I have not yet found a custom function that'll do the job and am not sure of how to write my own. Any help?
I am assuming that the results should appear as a list of values separated by returns.
//ListParse ( TheList )
//Use underscore as list separator and return list of values with one less list element in each subsequent value.
Let ( us = Position ( TheList ; "_" ; Length ( TheList ) ; -1 ) ; // Search right to left. 0 is returned if there are no underscores in TheList
Case ( not us ; TheList ; // If no underscore, return entire parameter
List ( TheList ; ListParse ( Left ( TheList ; us - 1 ) ) ) // Use recursion to return list of values
) // Case
) // Let
If you passed the underscore character as a parameter to this function and modified the position function call to use it, you could parse lists with any number of different delimitting characters.
I just tried this out this morning and it works perfectly -- but I guess you already knew that!!
I had tried a few different ideas but could not get it to drop the underscore for each subsequent value.
I like your last idea of passing parameters to the function. Could be useful for me down the road. I work in an engineering test lab and have to filter through a lot of repetitive information.
Thanks a million.
but I guess you already knew that
Yes, I like most such requests, I created and tested it--using the example data you provided, in my Known Bugs List database and then left it there for interested parties to discover...