MASS RENAME PROBLEM - What am I doing wrong?

Q & A for the old 2X Explorer file manager. For other topics, please use the corresponding forum.

Moderators: fgagnon, nikos, Site Mods

Post Reply
Forrest
New Member
Posts: 3
Joined: 2002 Jul 17, 00:24

Post by Forrest »

I've been using 2x Explorer for a while but have just tried the address bar command/batch processing function and couldn't get it to work for me.  Any tips would be appreciated.

2xExplorer.rtf gives the example of "ren $N $B.other" for batch renaming files and talks about using counters ($001) to create incrementally numbered files.  This sounds very handy for dealing with digital camera files, which appear on my system as dscn0223.jpg, dscn0224.jpg, dscn0225.jpg, etc.

I've selected (highlighted) the files I've wanted to rename and then gone to the address bar.  Here's what I've entered into the address bar, and the responses on the status bar at the bottom of the screen:

ren $N $223.jpg
The CPU cannot make any sense of that last input.

>ren $N $223.jpg
Cannot execute that command

$ren $N $223.jpg (or simply $ in the address bar)
MS DOS prompt window pops open

What am I doing wrong?
User avatar
nikos
Site Admin
Site Admin
Posts: 15879
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

the sample in 2xExplorer.rtf is presented in the context of batch templates [Ctr+B] command. For the address bar the things are a bit trickier --- but only just

first as you've discovered, to execute a command from the address bar you have to start with a special character, > or $ -- else 2x can't tell what it is and assumes it is a regular path

The ren command you're trying to use is a DOS command, it requires the DOS interpreter. For these commands you have to use a $ prefix. (> prefixed commands don't use DOS unless you've done something with szShellCmdPreample registry setting)

Now, let's consider the special tokens like $N. As I've explained in the tricks & tips #2 article, you can specify such special tokens in the address bar but they have a slightly different meaning.

For starters, counters are not supported, since they are not relevant; only one command will be issued from the address bar, for the item that is focused -- it won't apply it for all the selection. Automatic counters are only supported for batch file generation.

Even if they were supported, it's not clear what you would have achieved with your $223 token. It corresponds to a counter that starts @ 223 and increases by one for each command. I.e. if you had selected 5 items and built a batch file using the template ren $N $223.jpg, then you'd get this sequence of commands:

ren yourfilename1 223.jpg
ren yourfilename2 224.jpg
...
ren thatfilename5 227.jpg

is that what you were after?


To recap, if you want mass renaming you'll have to use the batch file generator [Ctrl+B] which will act on each file you have selected, applying your template.

From the address bar you can execute just one command; any $N you use then will be substituted by the focused item in the active pane (the one with the dotted rectangle around it). The only way you could do mass renaming from the address bar is if you used regular DOS wildcards, e.g. the command

$ ren *.txt *.bak

would change all the txt extensions in the current folder to bak
narayan
Platinum Member
Platinum Member
Posts: 1430
Joined: 2002 Jun 04, 07:01

Post by narayan »

If you prefer wizards to commands for the mass-renaming, then try the freeware: THE Rename

To find other renaming freeware, Click here
Forrest
New Member
Posts: 3
Joined: 2002 Jul 17, 00:24

Post by Forrest »

Thanks, Nikos, for your response.  That was most enlightening.

Yes, what I wanted to do was a mass rename like:
   ren dscn0223.jpg 223.jpg
   ren dscn0224.jpg 224.jpg
   ...

I wasn't aware of the Ctrl-B function for the batch processor.  In fact, after reading your post, I couldn't see it in keyboard.txt or 2xexplorer.rtf.  I must be overlooking it, for it is clearly what is needed.

Your post also made clear the distinction between entering commands in the address bar and Ctrl-B.  It makes perfect sense that the address bar can handle only a single command, since in essence it is passing variables to DOS.

The Ctrl-B dialog box is easy to use and informative (now that I have discovered it).  I'll definitely make use of it.

Forrest
Forrest
New Member
Posts: 3
Joined: 2002 Jul 17, 00:24

Post by Forrest »

Narayan, thanks for the tips on rename freeware.  I do use one called Renamer (not Renamer 3.3 in the Download.com listing) to lowercase files for the web, but I will look at some of these as well.

I like 2x Explorer for synchonizing files in different directories (particularly helpful when creating a master layout for a CD-ROM, to be sure that I have the latest versions of files from different work areas).  A specialized utility would be best for simply renaming files, but it is nice to have the batch capability within 2x Explorer so it doesn't require switching programs when managing files.

Forrest
Post Reply