Bulk file renaming

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

Moderators: fgagnon, nikos, Site Mods

Post Reply
User avatar
PhilipSutton
Member
Member
Posts: 31
Joined: 2002 Mar 06, 01:31
Location: Australia
Contact:

Post by PhilipSutton »

In Windows 3.1 Filemanager (and the secret Windows 98 8.3 format Filemanager) you could/can rename *many* files using a two window form:

From:    xxx.*
To:       yyy.*

Using this facility I could change, say:

EV core vision-strategy.tpz
EV core vision-strategy.hjt
EV core vision-strategy.tpz.bak
EV core vision-strategy.hjt.bak

to.....

My core vision-strategy.tpz
My core vision-strategy.hjt
My core vision-strategy.tpz.bak
My core vision-strategy.hjt.bak

..using...

From:    EV core vision-strategy.*
To:       My core vision-strategy.*

This bulk handling saves heaps of time.

As far as I can tell this function is not built into 2xExplorer - but it would be wonderful if it could be included in xplorer².

Cheers, Philip
Philip Sutton
Australia
http://www.green-innovations.asn.au/
User avatar
nikos
Site Admin
Site Admin
Posts: 15800
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

what you want can be achieved as a 2-stage process.
(1) move the files retaining the original names with F6
(2) do a batch renaming using ren "$N" "newName.$E" template in the target folder

2x after stage-1 will automatically select all the new names copied so your stage-2 will work with the correct set of files without any effort on your part (or you could save the original selection with [Ctrl+F11] and re-apply it to be even more certain)

not ideal but it can be done!
i'll think about providing a move+rename capability in the next generation of 2x
User avatar
PhilipSutton
Member
Member
Posts: 31
Joined: 2002 Mar 06, 01:31
Location: Australia
Contact:

Post by PhilipSutton »

Inspired by your suggestion I've just realised that you can do what File Manager does using the batchfile system without moving anything......

let's say you have some files called:

cat-mouse.doc
cat-nap.txt

you create a batch file:

ren "cat*.*" "dog*.*"

and run it and

your files are now:

dog-mouse.doc
dog-nap.txt

This isn't rocket science!  But it's a bit simpler than your move >> rename suggestion.

But the system described above doesn't work if you substitute a new string with more characters eg.

ren "cat*.*" "doggie*.*"

The extra specified replacement characters overwrite the residue of the file names eg.

doggieuse.doc
doggiep.txt

So I think a bit of special programming is needed to make a bulk renaming system more intelligent.

Cheers, Philip
Philip Sutton
Australia
http://www.green-innovations.asn.au/
User avatar
nikos
Site Admin
Site Admin
Posts: 15800
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

> But it's a bit simpler than your move >> rename suggestion

that's ok (and you don't even need a batch file, you can simply execute this as a dos $ command from the address bar. Still ren by itself won't move files from one folder to another, that's why you may need a stage-1

What the batch builder allows you is to avoid using wildcards *.* and instead work with the special $B/$N/$E tokens, whereupon the restriction you discovered limiting to the same number of characters is lifted, you can do pretty much whatever you want!
Post Reply