Enter space after last digit

Advanced Renamer forum
#1 : 08/07-19 01:42
Chris
Chris
Posts: 3
Hello,

I am looking to rename images to names with various prefixes such as the following examples:

AV1234 Name.jpg
AV12345 Name.jpg
1234.56.789 Name.jpg
UD1234.56.7899 Name.jpg

I am using 'list' method to enter the number prefix and name from separate columns in excel, however the location of the space between the number and name varies.

I have used the "add" method to enter a space at the 'x'th index character, however that only works for prefixes that have the same number of characters, and those that have more or less have spaces in the wrong place which I need to manually fix.

Is there a way I can tell renamer to input the space after the last digit the occurs in the file name, regardless of prefix character length?

Thanks for any help!


08/07-19 01:42 - edited 08/07-19 02:08
#2 : 08/07-19 03:12
Chris
Chris
Posts: 3
Reply to #1:

Update: I've found a work-around by just inserting a column in excel, between the number and name with a space in each cell, then copying all three columns to the 'list' method. This removes the need to do an 'add' method for the space during renaming, as it's already there.

For interest's sake, and to potentially remove the excel step in the future, is there a way to enter the space this using renamer as per my query?


08/07-19 03:12
#3 : 08/07-19 10:28
David Lee
David Lee
Posts: 1125
Reply to #2:
You haven't given us enough information about the possible formats of the prefix and name.

If the names never contain numerical digits then you can insert a space before the name using a regular expression in the Replace method:

Replace: "([a-zA-Z]*$)"
with: " \1"

Also you could import from your two Excel columns and add a space by saving as saving as a CSV file and using (from the menu bar) Import-> Data from CSV...

Select commas as separator and deselect "First line is header".

Then use the New name method with New name = "<Csv:1> <Csv:2>"

You should read the User Guide for information on all the methods.


08/07-19 10:28
#4 : 09/07-19 06:42
Chris
Chris
Posts: 3
Reply to #3:

Thank you David, both your suggestions worked well and have given me options to use.

The reason I didn't provide more name information is because what I did list is the usual extent of what I will be naming them. If any special cases occur I should be able to work them out. I just didn't feel it necessary to type a long list of potential names that I'll only occasionally encounter.

Also I have read the User Guide and have tested using various methods within my knowledge of the software, however I just wanted to ask those who have much more understanding of the software and expressions/scripting, such as yourself, than I currently do.

Thanks again for your helpful suggestions!


09/07-19 06:42