![]() |
Help - renaming files Guys As a useful source of information on all things.... I thought I'd try asking this here... We have to rename a whole bunch of files - somewhere in the region of 7500 to be precise. But, we need to retain the original name and append a revision number to them, so AB12345.xyz would become AB12345rev1.xyz Is there an easy way of doing this? Any useful little power tool that can be downloaded and used for it? Thanks for any advice - don't want to have to get someone to go through and rename them all manually Cheers Martin |
Dont know much about this really but Can you not just save a copy of the files into another folder and call it revisions, |
Quote:
No, it's to send to a sub-contractor, and with several thousand files floating about, they will inevitably get mixed up... and contractually we're obliged to name the files as such... |
well I hope someone can come up with an answer for you, I wouldnt fancy that job of renaming them all individually |
Save this as "rename.vbs" in the target directory. Edit it so that the sPath is the name of the folder, and the sExt is the name of the extension you wish to check (to filter for just .gif files, for example). Double click it in Windows Explorer and it should do the trick. -- 8< -- cut here -- 8< -- sPath = "c:\temp\folder\" sExt = ".gif" Set fsoObject = CreateObject("Scripting.FileSystemObject") Set fsoFolder = fsoObject.GetFolder(sPath) for each fsoFile in fsoFolder.Files if (Right(fsoFile.Name, Len(sExt)) = sExt) then sNewName = Replace(fsoFile.Name, ".", "_rev1.") fsoFile.Name = LCase(sNewName) end if next Set fsoFolder = Nothing Set fsoObject = Nothing |
if you can't find a windoze program copy the files onto a mac and run the automater action "rename finder items", select "add text", "after name" add rev1 and it'll batch rename them for you, you can create a copy if you don't want to rename the original files. |
Nice idea antony. Be brave martin, he's teaching you how to use script files :) BUT !!! test it out on something simple first ;) |
Quote:
Cheers for that.... as Phil says, I'll try it on something simple first.....! Martin |
Heh, obviously! PS. Where do I send the bill? |
Quote:
Poland... You take Zloty? :D |
Quote:
Gdzie są moje pieniądze? Jesteś taka uprzejma ;) |
whats wrong with good old dos ren *.* *rev1.* |
Quote:
Twoj czek jest na poczcie dziekuje ;) |
|
Quote:
That's just what I was going to say! I often use DOS or, as it's seems to be known now, Command Prompt (I know it's not exactly the same thing, but it doesn't make any practical difference) to rename and search for files. |
All times are GMT +1. The time now is 07:32. |
Powered by vBulletin 3.5.4 - Copyright © 2000 - 2025, Jelsoft Enterprises Ltd.
© Ducati Sporting Club UK