How to Re-name a Massive Number of Files

X

xxx.

I have a massive number of pdf files within a massive number
of folders (a few 100,000 files; 5000 folders & subfolders).

I need to re-name all of the files -- just giving them some
consecutive numbers or combination of letters and numbers
(e.g., first file called "ER000001," the second called
"ER000002," and so on) will be sufficient for my
purposes.

I've found utilities that do re-naming within a single
folder, but that would take days for the current set of
documents. I'm therefore looking for something that will go
through a tree structure in one swoop.

I need this for my business, so I'm happy to pay more than I
would for something just for my home computer.

Can anyone suggest a program that does this?
 
P

Pegasus \(MVP\)

I have a massive number of pdf files within a massive number
of folders (a few 100,000 files; 5000 folders & subfolders).

I need to re-name all of the files -- just giving them some
consecutive numbers or combination of letters and numbers
(e.g., first file called "ER000001," the second called
"ER000002," and so on) will be sufficient for my
purposes.

I've found utilities that do re-naming within a single
folder, but that would take days for the current set of
documents. I'm therefore looking for something that will go
through a tree structure in one swoop.

I need this for my business, so I'm happy to pay more than I
would for something just for my home computer.

Can anyone suggest a program that does this?

You can do this with a humble batch file, e.g. like so:
@echo off
set Source=d:\My Folder
set Number=0
setlocal EnableDelayedExpansion

dir /s /b /a-d "%Source%" > "%temp%\files.txt"
for /F "delims=" %%a in ('type "%temp%\files.txt"') do (
set /a Number=!Number!+1
echo ren "%%a" ER!Number!.pdf
)

With a little more effort you could restart the numbering
in each folder. As it is, it will keep on incrementing the
number.

You must remove the word "echo" in the second line from
the bottom to activate the batch file. Don't do this until you
have tested things. And remember to copy and paste the
batch file. Do not retype it - chances are that you would
get a few things wrong.

Now did you say you were prepared to pay real money for
this little effort?
 
G

Guest

Hi Peg.
You could have taken advantage of this person, but you didn't. I'ts good to
see that there are honest to goodness, HUMAN BEINGS, out there. Best wishes
to you and have a great day.
franktee
 
D

Donald Lessau

I have a massive number of pdf files within a massive number
of folders (a few 100,000 files; 5000 folders & subfolders).

I need to re-name all of the files -- just giving them some
consecutive numbers or combination of letters and numbers
(e.g., first file called "ER000001," the second called
"ER000002," and so on) will be sufficient for my
purposes.

I've found utilities that do re-naming within a single
folder, but that would take days for the current set of
documents. I'm therefore looking for something that will go
through a tree structure in one swoop.

I'm surprised to hear from you that specialized renaming utilities can't
recurse subfolders. It's a bit hard to believe...

Anyway, XYplorer (a file manager coming with a simple batch renamer) can do
this easily. It will also give you a preview, before actually starting the
job. How to do it:
(1) Use XYplorer's file search (Ctrl+F) to list all *.pdf files in all your
folders and subfolders.
(2) Sort the search results list the way you want the files numbered
(3) Select all items (Ctrl+A)
(4) Open Batch rename (Shift+F2)
(5) Enter your pattern, in your case: ER<#000001> (the *.pdf extensions
will be preserved)
(6) Hit OK, and you're done (or hit Preview, if you first want to see what
will happen)

Try it 30 days for free: http://www.xyplorer.com/

Don
 
P

Pegasus \(MVP\)

You might find that most contributors to this newsgroup are
volunteers who make their expertise freely available to those
who have a problem or a question. I'm no exception - there
are many others.
 
X

xxx.

Pegasus \(MVP\) said:
You can do this with a humble batch file, e.g. like so:
@echo off
set Source=d:\My Folder
set Number=0
setlocal EnableDelayedExpansion
dir /s /b /a-d "%Source%" > "%temp%\files.txt"
for /F "delims=" %%a in ('type "%temp%\files.txt"') do (
set /a Number=!Number!+1
echo ren "%%a" ER!Number!.pdf
With a little more effort you could restart the numbering
in each folder. As it is, it will keep on incrementing the
number.
You must remove the word "echo" in the second line from
the bottom to activate the batch file. Don't do this until you
have tested things. And remember to copy and paste the
batch file. Do not retype it - chances are that you would
get a few things wrong.
Now did you say you were prepared to pay real money for
this little effort?

Wow, that was fast. Thanks.

I confess I don't entirely understand the answer, since my
experience with batch files is very limited (i.e., copying
files for backup, and the like), but I'd say I'm 80% there.

In the meanwhile, though, I found a handy little program for
$19.95, which did the job in very short order. I'd recommend
it to anyone. It's called File and MP3 Tag Renamer, found at
http://www.123renamer.com/.

Thanks again.

Bud
 
P

Pegasus \(MVP\)

Wow, that was fast. Thanks.

I confess I don't entirely understand the answer, since my
experience with batch files is very limited (i.e., copying
files for backup, and the like), but I'd say I'm 80% there.

In the meanwhile, though, I found a handy little program for
$19.95, which did the job in very short order. I'd recommend
it to anyone. It's called File and MP3 Tag Renamer, found at
http://www.123renamer.com/.

Thanks again.

Bud

Watch out: Your reply appears to have chopped off the
last line in the batch file. The second line from the bottom
reads
echo ren "%%a" ER!Number!.pdf
and the last line must be a solitary closing bracket:
)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top