rename files to be numbered sequentially

J

Jack

Is it possible to use Windows Explore (File manager) to rename files so they
are numbered sequentially? That is, I have a lot of files in a folder that
I would like to rename by simply adding 001, 002, 003, 004, etc. to the
current file names.

Jack
 
G

Guest

Jack said:
Is it possible to use Windows Explore (File manager) to rename files so they
are numbered sequentially? That is, I have a lot of files in a folder that
I would like to rename by simply adding 001, 002, 003, 004, etc. to the
current file names.

Jack

Files - Rename

How to Rename Multiple Files with Windows Explorer. Start Windows Explorer.
To do so, click Start, point to All
Programs, point to Accessories, and then click Windows Explorer. Select
multiple files in a folder. To do so, press and
hold down the CTRL key while you are clicking files. After you select the
files, press F2. Type the new name, and then
press ENTER.

NOTE: When you complete the preceding steps, the highlighted state of all
files except one disappears, so it may appear
as if you are only renaming one file. However, after you press ENTER, all of
the files are renamed. When you rename multiple files, all of the renamed
files have the same name with a number in parentheses appended to the name to
make
the new file name unique. For example, if you type BUDGET as the new name,
the first file is named BUDGET. All of
the remaining selected files are named BUDGET( x ), where x is a unique
number, starting with (1).
 
J

Jack

That is good info. However, I want to put the sequencing numbers in front,
in addition, and keep the current file name, e.g.,
cat.jpg
cats.jpg
dog.jpg
dogs.jpg
elephant.jpg

to

001cat.jpg
002cats.jpg
003dog.jpg
004dogs.jpg
005elephant.jpg

I have a lot of pictures in different folders that I want to merge and
purge, and if I could number them first, it would keep things in order.

Jack






Jack said:
Is it possible to use Windows Explore (File manager) to rename files so they
are numbered sequentially? That is, I have a lot of files in a folder that
I would like to rename by simply adding 001, 002, 003, 004, etc. to the
current file names.

Jack

Files - Rename

How to Rename Multiple Files with Windows Explorer. Start Windows Explorer.
To do so, click Start, point to All
Programs, point to Accessories, and then click Windows Explorer. Select
multiple files in a folder. To do so, press and
hold down the CTRL key while you are clicking files. After you select the
files, press F2. Type the new name, and then
press ENTER.

NOTE: When you complete the preceding steps, the highlighted state of all
files except one disappears, so it may appear
as if you are only renaming one file. However, after you press ENTER, all of
the files are renamed. When you rename multiple files, all of the renamed
files have the same name with a number in parentheses appended to the name
to
make
the new file name unique. For example, if you type BUDGET as the new name,
the first file is named BUDGET. All of
the remaining selected files are named BUDGET( x ), where x is a unique
number, starting with (1).
 
R

Rock

Jack said:
That is good info. However, I want to put the sequencing numbers in front,
in addition, and keep the current file name, e.g.,
cat.jpg
cats.jpg
dog.jpg
dogs.jpg
elephant.jpg

to

001cat.jpg
002cats.jpg
003dog.jpg
004dogs.jpg
005elephant.jpg

I have a lot of pictures in different folders that I want to merge and
purge, and if I could number them first, it would keep things in order.

Jack






:




Files - Rename

How to Rename Multiple Files with Windows Explorer. Start Windows Explorer.
To do so, click Start, point to All
Programs, point to Accessories, and then click Windows Explorer. Select
multiple files in a folder. To do so, press and
hold down the CTRL key while you are clicking files. After you select the
files, press F2. Type the new name, and then
press ENTER.

NOTE: When you complete the preceding steps, the highlighted state of all
files except one disappears, so it may appear
as if you are only renaming one file. However, after you press ENTER, all of
the files are renamed. When you rename multiple files, all of the renamed
files have the same name with a number in parentheses appended to the name
to
make
the new file name unique. For example, if you type BUDGET as the new name,
the first file is named BUDGET. All of
the remaining selected files are named BUDGET( x ), where x is a unique
number, starting with (1).

Download IRfanview. It's a great freeware image viewer and has a module
for renaming files. XP can't do bulk renaming the way you want.
 
D

David Candy

Create two batch Files

Set X=0
for %%A IN (*.*) Do Call RenFile %%A


and call the second RenFile
set /a x=x+1
ren "%1" "%~n1%x%%~x1"

This will a an incrementing number to the end of the file name for all files in the folder it's run in.

The %x% substring is the number. To move to the front
ren "%1" "%x%%~n1%~x1"

%~n1 = Name
%~x1 = Extension (it includes the .)
 
T

Torgeir Bakken \(MVP\)

Jack said:
Is it possible to use Windows Explore (File manager) to rename files so they
are numbered sequentially? That is, I have a lot of files in a folder that
I would like to rename by simply adding 001, 002, 003, 004, etc. to the
current file names.

Jack
Hi

Some freeware utilities that might help you out:


CKRename:
http://www.musicsucks.com/CKSoft/index.htm

1-4a Rename (from the screen shoots it looks like this ones can take
sub-folders as well):
http://www.1-4a.com/rename/


You will find a lot of utils for this here as well:

http://downloads-zdnet.com.com/3120-20-0.html?qt=Renamer

http://downloads-zdnet.com.com/3120-20-0.html?qt=Rename
 
J

Jack

David,

I'm not sure I follow you.

Say the 1st batch file is FIRST.BAT and the 2nd is RenFile.bat

Does FIRST.BAT include:

Set X=0
for %%A IN (*.*) Do Call RenFile %%A
set /a x=x+1
ren "%1" "%~n1%x%%~x1"

Does RenFile.bat include:

ren "%1" "%x%%~n1%~x1"
%~n1 = Name
%~x1 = Extension


Jack



Create two batch Files

Set X=0
for %%A IN (*.*) Do Call RenFile %%A


and call the second RenFile
set /a x=x+1
ren "%1" "%~n1%x%%~x1"

This will a an incrementing number to the end of the file name for all files
in the folder it's run in.

The %x% substring is the number. To move to the front
ren "%1" "%x%%~n1%~x1"

%~n1 = Name
%~x1 = Extension (it includes the .)
 
D

David Candy

No.

Say you are doing all jpegs in c:\documents and settings\david candy\my documents\my pictures.

Create the two files in C:\program files

File 1 (two or three lines) but to make life easy we'll add one line (else the %~ will get even more complex and longer).
------------------------------------------

cd c:\documents and settings\david candy\my documents\my pictures
Set X=0
for %%A IN (*.jpg) Do Call "c:\program files\RenFile" %%A

File 2 (RenFile.bat) (two lines)
-------------------------------------------
set /a x=x+1
ren "%1" "%x%%~n1%~x1"

%1 is the file the batch file is working on passed by the first batch file (it's %%A in the first batch file)
%x% is our counter that is incremented by 1 each time renfile is called (the x=x+1 part)
%~n1 is a %1 but the ~n means just the name of it
%~x1 is %1 but the ~x means just the dot and extension

These are ways of breaking up the file name into parts. As we wish to insert numbers into the middle of a fully qualified path (eg c:\somefolder\<insert number>originalname.ext) we need to break it into pieces.

The upcoming replacement for this is even more bizzare.

Normally one would run these commands from the command prompt but I changed it a bit so dbl clicking file1 will do. Normally you type the first line of file 1 by hand then run the command. Then it work whereever you want, you'll have to edit file 1 if wanting to do a different folder (and remember that MY My Pics folder not yours so change it to yours)
 
J

Jack

David,

I'm not sure I follow you.

Say the 1st batch file is FIRST.BAT and the 2nd is RenFile.bat

Does FIRST.BAT include:

Set X=0
for %%A IN (*.*) Do Call RenFile %%A
set /a x=x+1
ren "%1" "%~n1%x%%~x1"

Does RenFile.bat include:

ren "%1" "%x%%~n1%~x1"
%~n1 = Name
%~x1 = Extension


BTW, I sent this same post on Sep 18, but I don't see it!?

Jack



Create two batch Files

Set X=0
for %%A IN (*.*) Do Call RenFile %%A


and call the second RenFile
set /a x=x+1
ren "%1" "%~n1%x%%~x1"

This will a an incrementing number to the end of the file name for all files
in the folder it's run in.

The %x% substring is the number. To move to the front
ren "%1" "%x%%~n1%~x1"

%~n1 = Name
%~x1 = Extension (it includes the .)
 
D

...D.

Is it possible to use Windows Explore (File manager) to rename files so they
are numbered sequentially? That is, I have a lot of files in a folder that
I would like to rename by simply adding 001, 002, 003, 004, etc. to the
current file names.

Jac

I've highlighted a bunch of files before (SP1), or all of them in a folder,
and renamed the 1st one, and it goes and renames all of the rest of the
highlighted files. So if you rename the first one as 1, I think it will
rename the rest like 1(2), 1(3), 1(4), 1(5) ... something like that I seem
to recall anyways...
-------
OT : The steel knights (st33l-Kn1ghts) is a small Yahoo Messenger based
chatroom club. Whether you are a techie or a newbie, female or male, we're
looking for some new blood. Requirements: be half-way mature... It's nice
to know the people you chat with in a chatroom environment.
http://www.steel-knights.com . (you can run Yahoo Messenger & Windows/MSN
Messenger at the same time with no conflicts).




...D.
 
J

Jack

David,

I'm not sure I follow you.

Say the 1st batch file is FIRST.BAT and the 2nd is RenFile.bat

Does FIRST.BAT include:

Set X=0
for %%A IN (*.*) Do Call RenFile %%A
set /a x=x+1
ren "%1" "%~n1%x%%~x1"

Does RenFile.bat include:

ren "%1" "%x%%~n1%~x1"
%~n1 = Name
%~x1 = Extension


BTW, I sent this same post on Sep 18, but I don't see it!?

Jack

Create two batch Files

Set X=0
for %%A IN (*.*) Do Call RenFile %%A


and call the second RenFile
set /a x=x+1
ren "%1" "%~n1%x%%~x1"

This will a an incrementing number to the end of the file name for all files
in the folder it's run in.

The %x% substring is the number. To move to the front
ren "%1" "%x%%~n1%~x1"

%~n1 = Name
%~x1 = Extension (it includes the .)
 
J

Jack

Rock --

IRfanview rocks!!!

Thanks!

Jack


Jack said:
That is good info. However, I want to put the sequencing numbers in front,
in addition, and keep the current file name, e.g.,
cat.jpg
cats.jpg
dog.jpg
dogs.jpg
elephant.jpg

to

001cat.jpg
002cats.jpg
003dog.jpg
004dogs.jpg
005elephant.jpg

I have a lot of pictures in different folders that I want to merge and
purge, and if I could number them first, it would keep things in order.

Jack






:




Files - Rename

How to Rename Multiple Files with Windows Explorer. Start Windows Explorer.
To do so, click Start, point to All
Programs, point to Accessories, and then click Windows Explorer. Select
multiple files in a folder. To do so, press and
hold down the CTRL key while you are clicking files. After you select the
files, press F2. Type the new name, and then
press ENTER.

NOTE: When you complete the preceding steps, the highlighted state of all
files except one disappears, so it may appear
as if you are only renaming one file. However, after you press ENTER, all of
the files are renamed. When you rename multiple files, all of the renamed
files have the same name with a number in parentheses appended to the name
to
make
the new file name unique. For example, if you type BUDGET as the new name,
the first file is named BUDGET. All of
the remaining selected files are named BUDGET( x ), where x is a unique
number, starting with (1).

Download IRfanview. It's a great freeware image viewer and has a module
for renaming files. XP can't do bulk renaming the way you want.
 

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