Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing batches of filenames

Status
Not open for further replies.

ags91

Vendor
Jul 16, 2001
10
AU
hi all,

i recieve weather data with the following example file format: IDR223.gif@20020101092913
i have approx. 200 files that i would like to change to be IDR223.20020101092913.gif or similar (ie. the gif extension at the end). This is so i can view the files sequentially in XP picture viewer.

Any idea how to change them with a batch process?

andrew
 
See my FAQ799-1408

Just click on the link and see how easy it is. The two rules for success are:
1. Never tell them everything you know.

 
hi jkrash,

Sorry,

i forgot to explain something clearly....my fault. Each file is named IDR223.gif@ and then the date (ie 20020101092913). i want to keep the date with the file.

in essence, every filename will be a different name however with 200 files all i want to do is rearrange the name.

andrew
 
if your file names are:

IDR223.gif@20020101092913
IDR223.gif@20020101092914
IDR223.gif@20020101092915

a sequence of file names like the sequence above (I changed the last number)

then at a command prompt in the folder/directory with all
the file names (e.g., c:\weatherdata) type this:

c:\weatherdata> rename *.gif@* *.gif

That command will change the above three files to

IDR223.gif@20020101092913.gif
IDR223.gif@20020101092914.gif
IDR223.gif@20020101092915.gif

If they are gif then the sytem will recognize them as such and you can double click on the first in the series and the viewer will open.

I know the names are kinda wierd but the final .gif is treated as an extension while the .gif in the middle is just a part of the file name.

Hope this helps

rjkrash



The two rules for success are:
1. Never tell them everything you know.

 
I negelected to mention that back in explorer if you click on View > Arrange Icons by > Name

The files will sort in ansi sequence. I think your "date" scheme will be good and if the IDR223 part changes say to IDR224 that will sort properly too. The two rules for success are:
1. Never tell them everything you know.

 
thanks rjkrash,

the command prompt concept was what i was looking for... its been a while since i used this approach.

just goes to show that good old command prompt is a handy tool when simple processes are needed.

andrew
 
Glad I could help.

If you need to do more complex renameing or other actions of/to files you can get a program called DIT2TEXT (search on the net for it it's freeware) that grabs all the files names in you directory and puts them into a text file. From there you can edit the list of names and use serach and replace etc. to build a batch file.

The two rules for success are:
1. Never tell them everything you know.

If you found this post helpful let me know by clicking on the tip vote below. *:->* If not, :~/ sorry

 
Just happened to come accross this today and thought you or someone else who read this post might find interesting.

Ther is a freeware program called LupasRENAME that does for renaming what Fuller did for brushes. Check it out at:


The two rules for success are:
1. Never tell them everything you know.
 
Just happened to come accross this today and thought you or someone else who read this post might find interesting.

There is a freeware program called LupasRENAME that does for renaming what Fuller did for brushes. Check it out at:


The two rules for success are:
1. Never tell them everything you know.
 
thanks,

you have been busy.... it seems to do what i want.

andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top