We’d like to remind Forumites to please avoid political debate on the Forum.
This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Can file renaming be this tough?
cem
Posts: 391 Forumite
in Techie Stuff
I have several thousand files in a folder (subfolders etc) which need to be renamed.
I need ‘w001 – ‘ added before the file names in sequential order so
W001 –
W002 –
W003 –
I have tried using pfrank and advance renamer but they both do not seem to allow for this kind of thing.
I would appreciate any help in getting this done please
I need ‘w001 – ‘ added before the file names in sequential order so
W001 –
W002 –
W003 –
I have tried using pfrank and advance renamer but they both do not seem to allow for this kind of thing.
I would appreciate any help in getting this done please
0
Comments
-
http://www.1-4a.com/rename/download.htm
This is what I use - it'll certainly do it. The simple interface probably should be enough but the advanced one, whilst counterintuitive at times, is certainly capable0 -
Have you tried this tool: http://www.bulkrenameutility.co.uk/Main_Intro.php0
-
As well as the stand-alone rename utilities, a lot of third party file managers (e.g. FreeCommander) have multi-file renaming functions.0
-
A DOS batch file (Code!) for you.
** BEWARE this is code - danger! **
** I provide no guarantee so backup your data FIRST**
Instructions:-
1. make a backup copy of your data (to a test area where this script can be run).
2. create file "clever.bat" - any name - and create it at the topmost directory where you want the files renamed. DO NOT PUT IT AT THE ROOT OF C: FOR OBVIOUS REASONS
3. here's the code@echo off set /a c=1 setlocal ENABLEDELAYEDEXPANSION for /f "delims=" %%f in ('dir /s/b *.*') do ( rem echo %%~nxf rem echo %%f set /a c=c+1 rem echo !c! call :check !c! "%%f" "%%~nxf" ) exit /b :check if %1 LSS 10 (ren %2 "W0000%1 - %3" goto Label ) if %1 LSS 100 (ren %2 "W000%1 - %3" goto Label ) if %1 LSS 1000 (ren %2 "W00%1 - %3" goto Label ) if %1 LSS 10000 (ren %2 "W0%1 - %3" goto Label ) if %1 LSS 100000 (ren %2 "W%1 - %3" goto Label ) :Label exit /b endlocalNOTES:
1. this will rename ALL FILES - see the *.* in the for loop
2. will handle upto 99,999 files
If there are more you will have to add to the code yourself.
3. OBVIOUSLY this is a "run once" program, SO MAKE SURE YOU RUN IT ON A BACKUP COPY OF YOUR FILES.
4. Does not handle files with names which include (,),[,] in their name.0 -
Quite a good BATch file, Mr Crab!
You might prefer the construct
set /a c+=1
rather than
set /a c=c+1
(to save all that extra typing!).0 -
Always a risk posting code (especially precarious batch scripts!) I just hope he doesn't run it from the root of a drive!!?!?
(and the echo commands cannot handle file name with [,],(,) etc but I'd better do some work now;)0 -
Thank you all...This did it: http://www.1-4a.com/rename/download.htm0
-
grumpycrab wrote: »
A DOS batch file (Code!) for you.
** BEWARE this is code - danger! **
** I provide no guarantee so backup your data FIRST**
Instructions:-
1. make a backup copy of your data (to a test area where this script can be run).
2. create file "clever.bat" - any name - and create it at the topmost directory where you want the files renamed. DO NOT PUT IT AT THE ROOT OF C: FOR OBVIOUS REASONS
3. here's the code@echo off set /a c=1 setlocal ENABLEDELAYEDEXPANSION for /f "delims=" %%f in ('dir /s/b *.*') do ( rem echo %%~nxf rem echo %%f set /a c=c+1 rem echo !c! call :check !c! "%%f" "%%~nxf" ) exit /b :check if %1 LSS 10 (ren %2 "W0000%1 - %3" goto Label ) if %1 LSS 100 (ren %2 "W000%1 - %3" goto Label ) if %1 LSS 1000 (ren %2 "W00%1 - %3" goto Label ) if %1 LSS 10000 (ren %2 "W0%1 - %3" goto Label ) if %1 LSS 100000 (ren %2 "W%1 - %3" goto Label ) :Label exit /b endlocalNOTES:
1. this will rename ALL FILES - see the *.* in the for loop
2. will handle upto 99,999 files
If there are more you will have to add to the code yourself.
3. OBVIOUSLY this is a "run once" program, SO MAKE SURE YOU RUN IT ON A BACKUP COPY OF YOUR FILES.
4. Does not handle files with names which include (,),[,] in their name.
:T
Of course, if you use Mac OS X, instead, all you need to do is run Automator, which is a utility built into its system.
It just works.
Nothing in all the world is more dangerous than sincere ignorance
and conscientious stupidity.Dr. Martin Luther King, Jnr.0 -
-
What a brilliant idea! Just spend another £1K++ on a new computer, to save having to take a little trouble on renaming some files. :rotfl:
John Gray,
Yours is a remarkably (and typically) foolish posting. The face you’ve hit squarely with the metaphorical custard pie you’ve thrown is your own.
Anyone possessed of an iota of intelligence and objectivity would, upon reading this thread, notice that I refrained scrupulously from posting to it in any way until the Windows-equipped OP had announced that the problem had been solved to the OP’s satisfaction, using Windows.
I’m delighted that the OP discovered a Windows based solution and I applaud the OP both for thanking those who attempted (unsuccessfully) to assist him/her to find it and for then posting what that actual solution proved to be. :T
At that point, however, the thread then became open to anyone to answer generally the question posed in its title; namely “Can file renaming be this tough?”. (It’s written in large, green letters at the top of the page for those who can’t remember it. It doesn’t ask “Can file renaming in Windows be this tough?” )
Only a halfwit (which would now seem to include a persistently self-evident Kiwit) could interpret what I wrote as being a suggestion – posted retrospectively – that the OP go out and purchase a Mac to resolve the OP’s own file-renaming problem.
Mine was an innocent observation, posted for the benefit of those reading this thread who use Mac OS X, instead of (or as well as – which I do) Windows, that the task in question can be performed, quickly and simply, by using a utility available within the Mac operating system itself, without having to seek a third-party solution which could also be infected with malware. Many Mac users may have been unaware that Automator exists. so I also posted a link to help them find it and use it.
If doing this provoked any Applephobes into betraying publicly, for all to see, both their bigotry and their profound stupidity by failing to grasp the point I was actually making, it will, fortuitously, have served a useful, if unintended, second purpose.
Deeply though anally-obsessive Windows users and Apple haters may (and clearly do) resent the fact, this sub-forum is open to all (it states that at the top of the page, too) and is provided for the benefit of all – not just those determinedly wedded to Windows or Linux who scorn all those who have tried both and have found that another operating system serves them better.
The real, but sad, joke is that you don't understand that.Nothing in all the world is more dangerous than sincere ignorance
and conscientious stupidity.Dr. Martin Luther King, Jnr.0
This discussion has been closed.
Confirm your email address to Create Threads and Reply
Categories
- All Categories
- 352.2K Banking & Borrowing
- 253.6K Reduce Debt & Boost Income
- 454.3K Spending & Discounts
- 245.3K Work, Benefits & Business
- 600.9K Mortgages, Homes & Bills
- 177.5K Life & Family
- 259.1K Travel & Transport
- 1.5M Hobbies & Leisure
- 16K Discuss & Feedback
- 37.7K Read-Only Boards
