I read this question and the answers, but I don’t seem to have understood it well enough.
I have a bunch of files that were converted from one format to another. The result is a long list of files, that look like <originanl_name>-converted.docx
. I want to remove the “-converted” part from the file names.
After reading this answer, I thought I could achieve this bij running
REN *-converted.* *.*
This, sadly, does not work.
I fiddled around with some test files but I still can’t figure out the exact rules.
Say we start with the following files:
abcalpha.abc
abcalpha.txt
abcbeta.abc
abcbeta.txt
Running REN abcalpha.* abc.*
removes all the “alpha”s from the file names.
Then running REN abc.* abcalpha.*
restores the file names to what they were.
This both is as I expected.
Now consider the files:
abcalpha.abc
abcalpha.txt
abcbeta.abc
abcbeta.txt
-------------
defalpha.abc
defalpha.txt
I want to remove the “alpha”s on the end of the file names.
As I mentioned, it would seem to me that REN *alpha.* *.*
should do the trick. It, however, does nothing (no error message either).
I would like to know why this doesn’t work, so I can gain understanding in how wildcards are read. What is the flaw in my reasoning?