When there are unknown numbers in a particular place, then you either have to get to know those (e.g. using the "for/f"-command), or have to use something that is able to search for structures in strings.
So that depends on the source file you want to process; if there's are only a single (or very few) occurency(/-ies) of those unknown numbers per file, then using for/f to split the string into parts along delimiter '_' (underscore character) and check if the format is correct might be sufficient, though that task easily gets complicated based on the strings or encding you are using.
Therefore in that case you have described, i would suggest to use the latter option (although you have probably have read into that topic a bit); for instance you could use regular expressions to describe the structure, which would make dave's
JREPL.BAT a possible candidate to use.
penpen