Is there any information on the invoice that is different like Customer or Account number? Is there a word in the filename or data that is different between each version of the invoice? There’s usually a word or string of words that can be used to make a decision on which script to use.
If there is not anything obvious like a word, then you need to decipher which format the data is in as your decision maker. To do so, you would need to check the position of a word or pattern that you are looking at to extract the data. In this case, you might consider using a Regex pattern. There is info online about how to set up your Regex, or provide an example text and maybe someone can help. The syntax would something like