06-20-2019 05:16 PM
I'm trying to find a way to differentiate duplicates of files based off of their revision. Two files are the same but of different revision if they have the same file name, but a different suffix (always a capital letter) at the end.
For instance:
ABC123A.xxx
ABC123B.xxx
are both of the same file but of a different revision.
ABC122A.xxx
ABC123B.xxx
are of different files and different revisions.
My problem is that I need to be able to determine if two files are the same but of different revisions. My idea for a solution was to strip the file extension, then split the remaining string into two, one being n-1 characters long, and the other being 1 character long. Is there a way to do this? All split string methods I've seen so far either require a complete match or a delimiter.
Thanks!
Solved! Go to Solution.
06-20-2019 05:37 PM
Use "String Subset"
06-20-2019 07:47 PM
To add to Prettypwnies anser:
/Y
06-20-2019 07:53 PM
Search and Replace string to find the location of your period (start of your file extension), decremented to get the rev digit, and fed into string subset of length 1 to pull out the character of interest.
06-21-2019 02:22 AM - edited 06-21-2019 02:40 AM
If the string format is really that easy (and stays that easy) use Scan From String.
Use format specifier "%[A-Z]%d%[A-Z]" (characters in string, number, characters in string), and you'll get the string and number as output (extract to get 3 outputs). Optionally, use "%[A-Z]%d%[A-Z].%s" to also get the extension.
Once you have the results, you can either use a set (new in LV2019), variant attributes or an array to spot duplicates. Not sure if that's the showstopper, but we can help once you're there.