renumbering with numbers in multiple places in the template

Ideas for improvements and requests for new features in XnView Classic

Moderators: XnTriq, helmut, xnview

Shokakusan
Posts: 10
Joined: Sat Jan 23, 2016 3:02 am

renumbering with numbers in multiple places in the template

Post by Shokakusan »

I frequently want to renumber multiple picture files containing month/year publication dates in the file name. I need to use the 1st set of digits in the file name to maintain a relative chronological order of the different sets of files while keeping files related to a particular order, together. As examples:

customer_name_one-001_wedding_notice_Feb-2014 ---------> customer_name_one-001_wedding_notice_Feb-2014
customer_name_one-002_wedding_notice_Feb-2014 ---------> customer_name_one-002_wedding_notice_Feb-2014
customer_name_one-004_wedding_notice_Feb-2014 ---------> customer_name_one-003_wedding_notice_Feb-2014
customer_name_one-005_wedding_notice_Feb-2014 ---------> customer_name_one-004_wedding_notice_Feb-2014

customer_name_one-011_special_event_flyer_May-2014 ----> customer_name_one-011_special_event_flyer_May-2014
customer_name_one-013_special_event_flyer_May-2014 ----> customer_name_one-012_special_event_flyer_May-2014
customer_name_one-014_special_event_flyer_May-2014 ----> customer_name_one-013_special_event_flyer_May-2014
customer_name_one-016_special_event_flyer_May-2014 ----> customer_name_one-014_special_event_flyer_May-2014
customer_name_one-020_special_event_flyer_May-2014 ----> customer_name_one-015_special_event_flyer_May-2014

customer_name_two-001_memorial_brochure_May-2014 ----> customer_name_two-001_memorial_brochure_May-2014
customer_name_two-003_memorial_brochure_May-2014 ----> customer_name_two-002_memorial_brochure_May-2014
customer_name_two-005_memorial_brochure_May-2014 ----> customer_name_two-003_memorial_brochure_May-2014

customer_name_two-011_dual_wedding_card_Jul-2014 ------> customer_name_two-011_wedding_card_Jul-2014
customer_name_two-013_dual_wedding_card_Jul-2014 ------> customer_name_two-012_wedding_card_Jul-2014

The most ideal solution would be for XnView Rename to recognize which set of digits are different in two or more files to be renumbered (the 1st set in all of the above cases).
As a temporary solution, an option that tells XnView to pick either the 1st (new suggestion) or the last (today's default behavior) set of digits will also work for my situation.

I could achieve the correct ordering of my files by re-arranging the position of the numbering, the order name, and the pub date, but as I currently have about 7500 files using this approach, that would be a lot of mass renaming.

Of course, comments are welcome.
Mixer
Banned
Posts: 166
Joined: Fri Aug 28, 2015 6:24 am

Re: renumbering with numbers in multiple places in the templ

Post by Mixer »

Comments? Maybe I have some.
It would be a plus if XnView had more flexible batch renamer. While this feature is in consideration and development, probably you could see if you can do what you want with some utility which specializes in renaming, like Advanced Renamer (it's free) or some another?
Shokakusan
Posts: 10
Joined: Sat Jan 23, 2016 3:02 am

Re: renumbering with numbers in multiple places in the templ

Post by Shokakusan »

Mixer wrote:Comments? Maybe I have some.
It would be a plus if XnView had more flexible batch renamer. While this feature is in consideration and development, probably you could see if you can do what you want with some utility which specializes in renaming, like Advanced Renamer (it's free) or some another?
In cases where I need to rename a set of sparesly numbered files (e.g.,1,2,4,5) without renumbering (in other words, keeping 1,2,4,5), I have recently installed and tried to learn how to use Rename Master. If Rename Master winds up being too much trouble, maybe I'll try Advanced Renamer. The trick in Rename Master is that I have to create a script with some sort of Name template (or pattern) and then find the directory and files that I want to rename, plus, I have to do this each time that I want to rename/renumber a different sets of files.

When I open XnView in the correct directory and select the files to renumber, it automatically creates the Name template from the 1st file name. I can use XnView to do what I want, but it is a hassle to type over the #### with the year and type over the 001 with ### in the Name template of the Batch Rename window--it would be nice if XnView just figured out the correct Name template by looking at the 1st two files to be renamed (or even if XnView had an option to replace the 1st set of digits instead of the last set of digits in the initial file name with ###...###).

I understand if the batch renamer is NOT on the top of the list to enhance (and my suggestion IS an enhancement), but if enhancing the batch renamer is under consideration, please throw my suggestions into the mix as well.
cday
XnThusiast
Posts: 4178
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: renumbering with numbers in multiple places in the templ

Post by cday »

Your problem is complicated by the fact that in practice the customer_name part of each filename will vary in length, which isn't reflected in the example problem posted above. I suspect the only way to get the general solution you need will be to use Regular expressions which are supported in several freeware renaming utilities, including Rename Master, Advanced Renamer and Bulk Rename Utility.

Regular expressions are very powerful but there is clearly some investment in time required to learn how to use them and I haven't made that myself; if you Google the term there are a number of tutorials available. Some renaming software utilities also have forums which might be a good place to seek help.

For handling variable length name strings this Advanced Renamer user guide page may provide some useful insights.

Alternatively, I suspect that a programmer could fairly easily code a utility that provides the general function you need, that might be an interesting project for someone, possibly a student if you could find the right person!
Shokakusan
Posts: 10
Joined: Sat Jan 23, 2016 3:02 am

Re: renumbering with numbers in multiple places in the templ

Post by Shokakusan »

cday wrote:Your problem is complicated by the fact that in practice the customer_name part of each filename will vary in length, which isn't reflected in the example problem posted above. I suspect the only way to get the general solution you need will be to use Regular expressions which are supported in several freeware renaming utilities, including Rename Master, Advanced Renamer and Bulk Rename Utility.
Your are quite right--the problem becomes more evident if I had used customer_three in my example above.
cday wrote:Regular expressions are very powerful but there is clearly some investment in time required to learn how to use them and I haven't made that myself; if you Google the term there are a number of tutorials available. Some renaming software utilities also have forums which might be a good place to seek help.

For handling variable length name strings this Advanced Renamer user guide page may provide some useful insights.

Alternatively, I suspect that a programmer could fairly easily code a utility that provides the general function you need, that might be an interesting project for someone, possibly a student if you could find the right person!
Both of these are good thoughts that I will explore--it just seems that XnView is so close since it already builds a renaming template from the 1st file, which automatically changes with each different customer as pointed out by "cday".