MRT: add text before -or- after file name?
Moderators: white, Hacker, petermad, Stefan2
-
- Junior Member
- Posts: 61
- Joined: 2018-03-28, 20:13 UTC
MRT: add text before -or- after file name?
Original Subject was: Restart Filenames
I need to use Multi Rename to, well, rename a bunch of files.
I feel like I knew how to do this at one point, but I keep screwing it up.
I need to ADD Text to the beginning of every file. I don't want to REPLACE anything, just add on to the beginning...
I need to use Multi Rename to, well, rename a bunch of files.
I feel like I knew how to do this at one point, but I keep screwing it up.
I need to ADD Text to the beginning of every file. I don't want to REPLACE anything, just add on to the beginning...
Dan: You're gonna need to get someone to fix my computer.
Kim: What's wrong with it?
Dan: It's in several pieces on my floor.
Kim: What's wrong with it?
Dan: It's in several pieces on my floor.
-
- Junior Member
- Posts: 61
- Joined: 2018-03-28, 20:13 UTC
Re: Restart Filenames
ALSO - I want to add text AFTER something as well.
I have a bunch of files numerically sequenced, I'd like to add a word AFTER the number - but keep the number.
If I search for \d it REPLACES not ADDS to...
I have a bunch of files numerically sequenced, I'd like to add a word AFTER the number - but keep the number.
If I search for \d it REPLACES not ADDS to...
Dan: You're gonna need to get someone to fix my computer.
Kim: What's wrong with it?
Dan: It's in several pieces on my floor.
Kim: What's wrong with it?
Dan: It's in several pieces on my floor.
Re: Restart Filenames
Use this maskI need to ADD Text to the beginning of every file. I don't want to REPLACE anything, just add on to the beginning...
Code: Select all
sometext_[N]
Re: Restart Filenames
Use this at "Rename mask: file name":I have a bunch of files numerically sequenced, I'd like to add a word AFTER the number - but keep the number.
Code: Select all
[N]yourtext
Code: Select all
[E]
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
-
- Junior Member
- Posts: 61
- Joined: 2018-03-28, 20:13 UTC
Re: Restart Filenames
Wow I was clearly jetlagged when I titled this thread!
ts4242 - Brilliant! Turns out I lied when I said I knew how to do that and had forgotten, because I certainly didn't know that. Thank you.
Petermad - I was unclear in my need. I need to add words after the number, yes, but the number is in the middle of the file name. So I need to find the number (I thought that was "/d$" but am clearly wrong), but not REPLACE the number - just add text after it. But not disturb the other text that's already there.
(For example, let's say I have "Before 001 Texas Plant.jpg", "Before 002 Texas Plant.jpg", etc., I need to change it to "Before 001 Assembly Area - Texas Plant.jpg", "Before 002 Assembly Area - Texas Plant.jpg"...))
Thanks!
ts4242 - Brilliant! Turns out I lied when I said I knew how to do that and had forgotten, because I certainly didn't know that. Thank you.
Petermad - I was unclear in my need. I need to add words after the number, yes, but the number is in the middle of the file name. So I need to find the number (I thought that was "/d$" but am clearly wrong), but not REPLACE the number - just add text after it. But not disturb the other text that's already there.
(For example, let's say I have "Before 001 Texas Plant.jpg", "Before 002 Texas Plant.jpg", etc., I need to change it to "Before 001 Assembly Area - Texas Plant.jpg", "Before 002 Assembly Area - Texas Plant.jpg"...))
Thanks!
Dan: You're gonna need to get someone to fix my computer.
Kim: What's wrong with it?
Dan: It's in several pieces on my floor.
Kim: What's wrong with it?
Dan: It's in several pieces on my floor.
Re: Restart Filenames
You need a subexpressions for search & replace, e.g.:
Search for:
(\d+)(.+)
Replace with:
$1 Assembly Area - $2
Search for:
(\d+)(.+)
Replace with:
$1 Assembly Area - $2
Re: Restart Filenames
If the number of characters until the end of the number is fixed (11 in your examples, including the space), you can also use "Rename mask: file name":
Code: Select all
[N1-11]Assembly Area -[N11-]
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
-
- Junior Member
- Posts: 61
- Joined: 2018-03-28, 20:13 UTC
Re: Restart Filenames
Yeah, it's not quite as clean as that... And they're not ALL "Assembly Area"... I'm spending more time figuring out the "algorithm" than probably just to grunt through it.
Thanks for your help, though! Very appreciated.
Thanks for your help, though! Very appreciated.
Dan: You're gonna need to get someone to fix my computer.
Kim: What's wrong with it?
Dan: It's in several pieces on my floor.
Kim: What's wrong with it?
Dan: It's in several pieces on my floor.
MRT: find a number and add before and after it new text
FROM:
Picture 001 Texas Plant.jpg
Picture 002 Texas Plant.jpg
TO:
Picture new-text-before number 001 after number Texas Plant.jpg
Picture new-text-before number 002 after number Texas Plant.jpg
USE in MRT
Name: [N]
Extension: [E]
Search : (\d+)
Replace: new-text-before number $1 after number
[x]RegEx
Explanation:
\d >>> match ''one digit''
+ >>> one-or-more of the expression right before, so here ''one-or-more of one digit''.
(...) >>> capture what is matched for reuse by ''$1'' in the replacement.
FAQs: Reguläre Ausdrücke Anleitung / Regular expressions Tutorial >>> viewtopic.php?p=323986#p323986
Picture 001 Texas Plant.jpg
Picture 002 Texas Plant.jpg
TO:
Picture new-text-before number 001 after number Texas Plant.jpg
Picture new-text-before number 002 after number Texas Plant.jpg
USE in MRT
Name: [N]
Extension: [E]
Search : (\d+)
Replace: new-text-before number $1 after number
[x]RegEx
Explanation:
\d >>> match ''one digit''
+ >>> one-or-more of the expression right before, so here ''one-or-more of one digit''.
(...) >>> capture what is matched for reuse by ''$1'' in the replacement.
FAQs: Reguläre Ausdrücke Anleitung / Regular expressions Tutorial >>> viewtopic.php?p=323986#p323986