You are not logged in.
Pages: 1
Hi, I have some trouble to filtering file names.
I have a folder with 40000 files, that are in format
1 - 9999 (four digit file names)
10000 - 40000 (five digit file names)
I need Renamer to filter only 4 digit file names from 1 to 9999 and add zero on front. I have done this using delete rule from 1 till the end and then I serialize the file names. But maybe there is a better way.
Now I have to copy 9999 files to separate folder and rename them there
Offline
From your text I guess your file name look like 0001 to 9999?
From your example it looks like 1 to 9999?
You can use an RegEx rule.
1) RegEx: Replace expression "^(.{4})$" with "0$1" (skip extension)
Explanation:
Use RegEx meta sign '^' to match start of an string / file name
and '$' to match the end.
In between we match exactly four signs only.
So we would use an expression like:
^.{4}$
The dot will match any sign, and the {4} construct will match 4 times of the expression right before, the dot in our case.
If your file names really are like 1 to 9999 use {1,4} instead.
We can exchange the dot by an '\d' to say "match one digit" out of 0,1,2,3...
instead of any sign (like chars, signs, blanks) as the dot would match.
So our expression would look like:
^\d{4}$
Now, since we want to use what is captures in this match in the output,
we group this expression in parenthesis () like:
^(\d{4})$
In the output we use '$1' to get the capture of the first (and only one here) match:
$1
Now only add an leading zero like
0$1
and you are done.
.
Read the *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)
Offline
Pages: 1