Another little problem has come up....
I'm generating a bunch of contour plot images in a statistics program. The resulting plot images are supposed to be named according to the script of commands as such:
I've deliberately set up this naming approach because of the problem I'm about the describe.
For some crazy reason the program creating the plot images adds numbers to the ends of the names:
I would like the original names, or, rather, the names as they were intended to be.
One solution to the problem is to create a batch file:
ren _50501_22004_22404_3000.png _50501_22004_22404_.png
The total number of files is in the tens of thousands. Over repeated times. I believe all the underlying names are unique (no repeats).
I'm wondering if any of you can come up with a better approach than creating a basic batch file to chop off that extra junk after the third underline character, but, of course, before the file name extension.
Or, chop junk BETWEEN third underline character and period of the file extension.
Some of you might come up with a magic RegEx solution? Please then suggest, too, a RegEx program.
Or maybe one of you will create a small program to do the trick? Hopefully generalizable so that others can use the program for their specific needs.
Not sure. If no better solution than the creating basic batch file approach, I'll have to continue using that.