0

I am trying to check a batch of file names and change the name the files look like the following

er-1.gif

I need to check the numbers after the dash and then look through an array to find what number i need to replace er with.

How can i create a batch file to-do this?

I have Windows & Mac available to work on.

4

1 回答 1

1

You can parse the filename using regex. This will return you the integer you're interested in.

Then look up the corresponding name in your array and write to a new file with the new name

If you know that the number after the '-' is the only number in the whole string you can simply use "\d" as your regex expression.

于 2013-05-22T08:56:00.737 回答