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.
are both of the same file but of a different revision.
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.
Solved! Go to Solution.
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.
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.