Mask to insert space counting from end of filename
Moderators: Hacker, petermad, Stefan2, white
Mask to insert space counting from end of filename
What mask in the Multi Rename Tool will put a space before the last 3 characters of a filename?
For example:
house123 ---> house 123
apartment999 ---> apartment 999
For example:
house123 ---> house 123
apartment999 ---> apartment 999
- Wilhelm M.
- Power Member
- Posts: 1054
- Joined: 2003-06-05, 10:45 UTC
Re: Mask to insert space counting from end of filename
Perhaps [N1--4] [N-3,3] does the job? Don't forget the blank between the brackets.
Grüße/Regards,
Wilhelm
Wilhelm
Re: Mask to insert space counting from end of filename
That's great,thank you. I can't manage to puzzle out the way it works (even using the syntax shown on the help page) but when I get a clear-headed moment I must study it and learn!
I have a related question, if you're able to help ...
I name a set of picture files named by using with a subject description followed by a sequence number. After that I sometimes add the exclamation symbol to selected pictures as a form of rating. Sometimes I might use two exclamation symbol or even three. It looks like this (there's a space before the exclamation symbols and a space after).
the house on the hill 001.jpg
the house on the hill 002 ! .jpg
the house on the hill 003 !! .jpg
the house on the hill 004 !!! .jpg
As part of editing, I will delete photos which makes sequence is non-linear. See here:
the house on the hill 001.jpg
the house on the hill 002 ! .jpg
the house on the hill 004 !!! .jpg
Is there a way for TC to re-apply the sequence numbers?
I could do this for one set of files by counting the number of characters from the start of the file name but I would like to be able to do this for any set of files with any description. Perhaps this can be done by counting from the end while ignoring the exclamation symbols -- but how? Is it possible?
Thanks for any information.
I have a related question, if you're able to help ...
I name a set of picture files named by using with a subject description followed by a sequence number. After that I sometimes add the exclamation symbol to selected pictures as a form of rating. Sometimes I might use two exclamation symbol or even three. It looks like this (there's a space before the exclamation symbols and a space after).
the house on the hill 001.jpg
the house on the hill 002 ! .jpg
the house on the hill 003 !! .jpg
the house on the hill 004 !!! .jpg
As part of editing, I will delete photos which makes sequence is non-linear. See here:
the house on the hill 001.jpg
the house on the hill 002 ! .jpg
the house on the hill 004 !!! .jpg
Is there a way for TC to re-apply the sequence numbers?
I could do this for one set of files by counting the number of characters from the start of the file name but I would like to be able to do this for any set of files with any description. Perhaps this can be done by counting from the end while ignoring the exclamation symbols -- but how? Is it possible?
Thanks for any information.
Last edited by spikey on 2020-07-15, 17:58 UTC, edited 1 time in total.
- Wilhelm M.
- Power Member
- Posts: 1054
- Joined: 2003-06-05, 10:45 UTC
Re: Mask to insert space counting from end of filename
I guess you have mixed up your example - both lists show the same filenames. But I think I understand anyway.
Try [N1-22][C][N26-]. The [N1-22] keeps the part that should not be changed. Then insert the counter (3 digits) and then the rest of the name that also should remain unchanged. In your example this rest is character 26 till the end of the name [N26-].
Hope that works. It's just a trial-and-error affair for me - same as for you.
Try [N1-22][C][N26-]. The [N1-22] keeps the part that should not be changed. Then insert the counter (3 digits) and then the rest of the name that also should remain unchanged. In your example this rest is character 26 till the end of the name [N26-].
Hope that works. It's just a trial-and-error affair for me - same as for you.
Grüße/Regards,
Wilhelm
Wilhelm
Re: Mask to insert space counting from end of filename
Here I am showing my way of doing this.
FROM:
the house 235 on the hill001.jpg
the house 235 on the hill002 ! .jpg
the house 235 on the hill004 !!! .jpg
the house 333 ! on the hill002 !.jpg
the house 333 ! on the hill002 ! - Copy.jpg
TO:
the house 235 on the hill 001.jpg
the house 235 on the hill 002 ! .jpg
the house 235 on the hill 004 !!! .jpg
the house 333 ! on the hill 002 !.jpg
the house 333 ! on the hill002 ! - Copy.jpg
Using Regular Expressions
Search for: ^(.+?)(\d\d\d[\s!]*)$
Replace with: $1 $2
☐⩟ ☐1x ☐[E] ☑RegEx ☐Subst
Explanation:
^ -------- match at start
(.+?) ---- match everything but non-greedy, and store in $1
(\d\d\d -match next three digits, and
[\s!]*) -- an Space or !, null-or-more times, and store all together in $2
$ -------- match all this at the end of the string
So matching three digits and following one-or-more space or exclamation mark at the end.
Replace with the matched parts and add the wanted space yourself between $1 and $2.
You can also equivalent "Search for:"
^(.+?)(\d\d\d[ !]*)$
or
^(.+?)(\d{3}[ !]*)$
FROM:
the house 235 on the hill001.jpg
the house 235 on the hill002 ! .jpg
the house 235 on the hill004 !!! .jpg
the house 333 ! on the hill002 !.jpg
the house 333 ! on the hill002 ! - Copy.jpg
TO:
the house 235 on the hill 001.jpg
the house 235 on the hill 002 ! .jpg
the house 235 on the hill 004 !!! .jpg
the house 333 ! on the hill 002 !.jpg
the house 333 ! on the hill002 ! - Copy.jpg
Using Regular Expressions
Search for: ^(.+?)(\d\d\d[\s!]*)$
Replace with: $1 $2
☐⩟ ☐1x ☐[E] ☑RegEx ☐Subst
Explanation:
^ -------- match at start
(.+?) ---- match everything but non-greedy, and store in $1
(\d\d\d -match next three digits, and
[\s!]*) -- an Space or !, null-or-more times, and store all together in $2
$ -------- match all this at the end of the string
So matching three digits and following one-or-more space or exclamation mark at the end.
Replace with the matched parts and add the wanted space yourself between $1 and $2.
You can also equivalent "Search for:"
^(.+?)(\d\d\d[ !]*)$
or
^(.+?)(\d{3}[ !]*)$
Re: Mask to insert space counting from end of filename
Hi Wilhelm. You're right I messed up my example. I have gone back and corrected it now.Wilhelm M. wrote: 2020-07-15, 10:00 UTC I guess you have mixed up your example - both lists show the same filenames. But I think I understand anyway.
Try [N1-22][C][N26-]. The [N1-22] keeps the part that should not be changed. Then insert the counter (3 digits) and then the rest of the name that also should remain unchanged. In your example this rest is character 26 till the end of the name [N26-].
Hope that works. It's just a trial-and-error affair for me - same as for you.
Your solution requires me to count the number of characters from the beginning of the file name but the description part (before the number and the exclamation sign) will change from one set of photos to another. I would like to avoid doing this count for every set.
Re: Mask to insert space counting from end of filename
Some of the characters after you wrote "replace with" (and the line following) don't display up on my browser.
I can't see exactly what you have written.
- Wilhelm M.
- Power Member
- Posts: 1054
- Joined: 2003-06-05, 10:45 UTC
Re: Mask to insert space counting from end of filename
@stefan2
The same here. I only see
Search for: ^(.+?)(\d\d\d[\s!]*)$
Replace with: $1 $2
☐⩟ ☐1x ☐[E] ☑RegEx ☐Subst
Surely you didn't want it to look like this. Besides, this sometimes happens with your postings . Why?
The same here. I only see
Search for: ^(.+?)(\d\d\d[\s!]*)$
Replace with: $1 $2
☐⩟ ☐1x ☐[E] ☑RegEx ☐Subst
Surely you didn't want it to look like this. Besides, this sometimes happens with your postings . Why?
Grüße/Regards,
Wilhelm
Wilhelm
Re: Mask to insert space counting from end of filename
Hi!
Whit which browser do you have problems to see the whole post?
- - -
You say you don't see this following in my post above?
---------8<--------------snip----------8<---------
Explanation:
^ -------- match at start
(.+?) ---- match everything but non-greedy, and store in $1
(\d\d\d -match next three digits, and
[\s!]*) -- an Space or !, null-or-more times, and store all together in $2
$ -------- match all this at the end of the string
So matching three digits and following one-or-more space or exclamation mark at the end.
Replace with the matched parts and add the wanted space yourself between $1 and $2.
You can also equivalent "Search for:"
^(.+?)(\d\d\d[ !]*)$
or
^(.+?)(\d{3}[ !]*)$
--------->8--------------snip---------->8---------
- - -
the whole post from above:
Whit which browser do you have problems to see the whole post?
- - -
You say you don't see this following in my post above?
---------8<--------------snip----------8<---------
Explanation:
^ -------- match at start
(.+?) ---- match everything but non-greedy, and store in $1
(\d\d\d -match next three digits, and
[\s!]*) -- an Space or !, null-or-more times, and store all together in $2
$ -------- match all this at the end of the string
So matching three digits and following one-or-more space or exclamation mark at the end.
Replace with the matched parts and add the wanted space yourself between $1 and $2.
You can also equivalent "Search for:"
^(.+?)(\d\d\d[ !]*)$
or
^(.+?)(\d{3}[ !]*)$
--------->8--------------snip---------->8---------
- - -
the whole post from above:
Stefan2 wrote: 2020-07-15, 11:30 UTC START
Here I am showing my way of doing this.
FROM:
the house 235 on the hill001.jpg
the house 235 on the hill002 ! .jpg
the house 235 on the hill004 !!! .jpg
the house 333 ! on the hill002 !.jpg
the house 333 ! on the hill002 ! - Copy.jpg
TO:
the house 235 on the hill 001.jpg
the house 235 on the hill 002 ! .jpg
the house 235 on the hill 004 !!! .jpg
the house 333 ! on the hill 002 !.jpg
the house 333 ! on the hill002 ! - Copy.jpg
Using Regular Expressions
Search for: ^(.+?)(\d\d\d[\s!]*)$
Replace with: $1 $2
☐⩟ ☐1x ☐[E] ☑RegEx ☐Subst
Explanation:
^ -------- match at start
(.+?) ---- match everything but non-greedy, and store in $1
(\d\d\d -match next three digits, and
[\s!]*) -- an Space or !, null-or-more times, and store all together in $2
$ -------- match all this at the end of the string
So matching three digits and following one-or-more space or exclamation mark at the end.
Replace with the matched parts and add the wanted space yourself between $1 and $2.
You can also equivalent "Search for:"
^(.+?)(\d\d\d[ !]*)$
or
^(.+?)(\d{3}[ !]*)$
END
- Wilhelm M.
- Power Member
- Posts: 1054
- Joined: 2003-06-05, 10:45 UTC
Re: Mask to insert space counting from end of filename
Firefox, PaleMoon, Opera ... you name it. In my opinion this problem has nothing to do with the browsers.
Here a copy from your last post:
Replace with: $1 $2
☐⩟ ☐1x ☐[E] ☑RegEx ☐Subst
Always the same.
Here a copy from your last post:
Replace with: $1 $2
☐⩟ ☐1x ☐[E] ☑RegEx ☐Subst
Always the same.
Grüße/Regards,
Wilhelm
Wilhelm
Re: Mask to insert space counting from end of filename
Don't know why. I see it with PaleMoon, IE and Chrome and on two PCs.
Here is an picture of my post (will expire in one day)
https://ibb.co/br1Fqsw
Here is an picture of my post (will expire in one day)
https://ibb.co/br1Fqsw
Re: Mask to insert space counting from end of filename
Works fine on Firefox and the Black forum style.
Roman
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Re: Mask to insert space counting from end of filename
It seems that you have some problems with font cache or fonts themselves. What Windows do you use?Wilhelm M. wrote: 2020-07-15, 20:33 UTC Firefox, PaleMoon, Opera ... you name it. In my opinion this problem has nothing to do with the browsers.
I can see both copied lines in Firefox 52 and IE8 in Windows XP when opening the forum in its default style.
Last edited by Usher on 2020-07-16, 12:59 UTC, edited 1 time in total.
Andrzej P. Wozniak
Polish subforum moderator
Polish subforum moderator
Re: Mask to insert space counting from end of filename
2spikey
2Wilhelm M.
Those of you who doesn't see my above post entirely, may you please upload
an screenshot of what you see to some external hoster and post the URL here?
Re: Mask to insert space counting from end of filename
Here's a screenshot of the problem as requested. Please excuse the hosting site's banners. I have added only the arrow but not the blue coloring shown. https://ibb.co/R41bnrDStefan2 wrote: 2020-07-16, 08:20 UTCThose of you who doesn't see my above post entirely, may you please upload an screenshot of what you see to some external hoster and post the URL here?
Back to the main matter .... I can't manage to use the regex you gave. I copied and pasted it into the "SEARCH FOR" box in the "SEARCH AND REPLACE" section of the Multi-Rename Tool, and then I checked the "REGEX" box. I entered some dummy characters in the "REPLACE WITH" box.
However this didn't do anything. I also tried using the two regexes you gave at the end but with no success.
Am I doing this right? I don't understand where your $1 and $2 comes into it, perhaps on account of the problem we're discussing to do with seeing that line in your post.