batch rename; shift range of numbered filenames

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
guster
Posts: 13
Joined: 18 Jul 2006 21:48

batch rename; shift range of numbered filenames

Post by guster »

This was posted in the “Wishes” forum by mistake. Please forgive the error and this cross-posting

I have files t1.asc through t16.asc in a bunch of directories. For some directories I need to ratchet t#-end forward or backward. There are other trials in the series, and in the rest of the directory (some other series' and individual files) which should remain unaltered.

In one directory, I renamed t3 to tp3 manually. Then, in batch rename, I tried:

t<#4-#17>.asc = t3.asc

with t4.asc through t17.asc highlighted. The output form: t00004.asc = t3.asc

Will you please show me the syntax to get t3.asc --- t16.asc. Thank you.

admin
Site Admin
Posts: 65185
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: batch rename; shift range of numbered filenames

Post by admin »

guster wrote:This was posted in the “Wishes” forum by mistake. Please forgive the error and this cross-posting

I have files t1.asc through t16.asc in a bunch of directories. For some directories I need to ratchet t#-end forward or backward. There are other trials in the series, and in the rest of the directory (some other series' and individual files) which should remain unaltered.

In one directory, I renamed t3 to tp3 manually. Then, in batch rename, I tried:

t<#4-#17>.asc = t3.asc

with t4.asc through t17.asc highlighted. The output form: t00004.asc = t3.asc

Will you please show me the syntax to get t3.asc --- t16.asc. Thank you.
Whoops, there you misread the help file or wiki (I just improved that part). "t<#4-#17>.asc = t3.asc" is not a valid pattern. Instead do it like this:

1. Select the files to be renamed
2. Enter this template: t<#3>.asc
3. Click OK. Now the 1st file will be renamed to "t3.asc", the next to "t4.asc" etc. The files are renamed in the order in which they are currently listed.
4. BTW: if your files are already *.asc, then you can leave the extension out of the template and simply use: t<#3>

guster
Posts: 13
Joined: 18 Jul 2006 21:48

Post by guster »

"...
1. Select the files to be renamed
2. Enter this template: t<#3>.asc
3. Click OK. Now the 1st file will be renamed to "t3.asc", the next to "t4.asc" etc. The files are renamed in the order in which they are currently listed.
4. BTW: if your files are already *.asc, then you can leave the extension out of the template and simply use: t<#3>
..."

Thank you very much; that is a great start for me.

But, t<#3> stripped the extension. On a second pass, I used t<#3>.asc to get it tacked back on.

I was going to ask how to instruct a range within a longer sequence of files, but it seems evident that it only operates on the selected files. I already had a partial range, with files not included at the beginning. Also, it is evident that sorting in various orders in advance determines the order of operation (you said this in your own way).

Can a long list be defined in the pattern, rendering selection unnecessary? And, can the operation order be made implicit by the prior filenames (t3, t4, t5, t6 ...)?

I assume the complexity of different tasks can vary a lot and that regexp becomes neccessary for the harder tasks. Are there some general factors to consider that can determine when regexp is the better tool, or is it always a matter of trial and error?

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Post by jacky »

guster wrote:But, t<#3> stripped the extension.
I'd sat that's odd. Or maybe you don't have the latest version, at one point that behavior might have been different :unsure:
Just tried it quickly to make sure, t<#1> kept the extensions untouched for me...
guster wrote:Can a long list be defined in the pattern, rendering selection unnecessary?
Not really, but with Ctrl+M you can define a Selection Filter, eg. file##.* to select all corresponding files. Then just use Batch Rename (F2) as usual ;)
guster wrote:And, can the operation order be made implicit by the prior filenames (t3, t4, t5, t6 ...)?
Not sure I understand you there. You mean the original filenames? If so, just sort your list by Names ;)
Proud XYplorer Fanatic

admin
Site Admin
Posts: 65185
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

guster wrote:Can a long list be defined in the pattern, rendering selection unnecessary? And, can the operation order be made implicit by the prior filenames (t3, t4, t5, t6 ...)?
I'm not sure what you mean by this, but I plan to add something that might help here: "rename by list". You will get a simple multi-line edit field where you can type or paste any number of filenames (one per row). They will then be mapped onto the selected items. This will allow you to do extremely irregular batch renames that no template and no RegExp could do. Like a "multiple hard rename".

guster
Posts: 13
Joined: 18 Jul 2006 21:48

Post by guster »

I just found that I needed to update v 4.5 to v 5.1.

Do I uninstall first or install on top of the old to update?

guster
Posts: 13
Joined: 18 Jul 2006 21:48

selection filter

Post by guster »

admin wrote:
guster wrote:Can a long list be defined in the pattern, rendering selection unnecessary? And, can the operation order be made implicit by the prior filenames (t3, t4, t5, t6 ...)?
I'm not sure what you mean by this, but I plan to add something that might help here: "rename by list". You will get a simple multi-line edit field where you can type or paste any number of filenames (one per row). They will then be mapped onto the selected items. This will allow you to do extremely irregular batch renames that no template and no RegExp could do. Like a "multiple hard rename".
The selection filter (previous post) will be an important tool for this. I was thinking of a way around selecting multiple files individually from large directories. And, your multiple entry bars should take care of anything else. [The power still grows!] Thank you.

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Post by j_c_hallgren »

guster wrote:I just found that I needed to update v 4.5 to v 5.1.
Do I uninstall first or install on top of the old to update?
I always just install over the prior vers...just make sure XY isn't running at the time! :wink:
On very rare occasions, there can be some options/values that change function or settings so always check the change log to see what's involved in updates.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Post by jacky »

admin wrote:I'm not sure what you mean by this, but I plan to add something that might help here: "rename by list". You will get a simple multi-line edit field where you can type or paste any number of filenames (one per row). They will then be mapped onto the selected items. This will allow you to do extremely irregular batch renames that no template and no RegExp could do. Like a "multiple hard rename".
Not really related, but you know what would be nice too? When "Drop Stack" will be there, if one could reorder files inside the DS as he wants (I mean drag&drop them within the List to order them as whishes), so when we trigger the Batch Rename we could have choosen the order in which files will be renamed, can be pretty usefull, especially when used with the counter/increment! :idea:
Proud XYplorer Fanatic

admin
Site Admin
Posts: 65185
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

jacky wrote:
admin wrote:I'm not sure what you mean by this, but I plan to add something that might help here: "rename by list". You will get a simple multi-line edit field where you can type or paste any number of filenames (one per row). They will then be mapped onto the selected items. This will allow you to do extremely irregular batch renames that no template and no RegExp could do. Like a "multiple hard rename".
Not really related, but you know what would be nice too? When "Drop Stack" will be there, if one could reorder files inside the DS as he wants (I mean drag&drop them within the List to order them as whishes), so when we trigger the Batch Rename we could have choosen the order in which files will be renamed, can be pretty usefull, especially when used with the counter/increment! :idea:
Yep, that's a cool idea I have not thought of yet. Actually it will work by itself because DS will be defined via Catalog, and in Catalog you can order items already by drag&drop. The list will initially follow that order unless you sort it by column headers.

Post Reply