| View previous topic :: View next topic |
| Author |
Message |
louwin Junior Member


Joined: 09 Jun 2007 Posts: 63 Location: Perth, Western Australia
|
Posted: Fri Apr 13, 2012 8:27 pm Post subject: Really complex RegEx question :) |
|
|
I apologise if this is the wrong place to post this thread/question. Maybe I should look for a RegEx forum but there are some VERY smart people on THIS forum
I have many folders structured thus:-
Author1
--first book title.txt
--second book title.rtf
--third book
----Title.doc
----Cover.jpg
Author2
.etc.
Is there a RegEx that will append an " - " and the Author to each book title using the Multi Rename Tool? The first 2 books are difficult enough and I suspect the third book structure is impossible?
There can be 1 to many book titles and different file types involved in each Author folder.
I also suspect that RegExs only work at one level
I'll be more than happy with any solution that will save me manual effort
I have about 400 authors and I have already done a couple of hundred manually
Thanks in anticipation  _________________ They said the job couldn't be done,
With a smile on his face he tackled the job
That they said couldn't be done
And he couldn't do it! |
|
| Back to top |
|
 |
louwin Junior Member


Joined: 09 Jun 2007 Posts: 63 Location: Perth, Western Australia
|
Posted: Fri Apr 13, 2012 8:30 pm Post subject: |
|
|
If not possible with RegEx I would be also be grateful for a "Batch" file solution  _________________ They said the job couldn't be done,
With a smile on his face he tackled the job
That they said couldn't be done
And he couldn't do it! |
|
| Back to top |
|
 |
MVV Power Member


Joined: 03 Aug 2008 Posts: 4534 Location: Russian Federation
|
Posted: Sat Apr 14, 2012 10:03 am Post subject: |
|
|
You don't ever need RegEx to do such thing.
1. Press Ctrl+B to see all files in all author's folders.
2. Select all files and press Ctrl+M.
3. Enter name template [P] - [N] (or [N] - [P] in order to append author name after book name) and extension template [E]
4. All other parameters should be in default state (no search/replace, no case change etc).
BTW you can press F1 in MRT window and read about all supported parameters like [P]. And, you've selected right subforum. _________________ VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo… |
|
| Back to top |
|
 |
louwin Junior Member


Joined: 09 Jun 2007 Posts: 63 Location: Perth, Western Australia
|
Posted: Sat Apr 14, 2012 7:03 pm Post subject: |
|
|
******* hell! (please insert expletive in place of *******)
What an unbeleiveable solution (and ssssooooo easy).
I didn't believe it while I read it!
Tried it and it works ******* perfectly!
I got a reply (by email) from White which detailed a brilliant RegEx solution but this one takes the cake!!!!
THANK YOU
I wish I had asked this question 200 manually renamed Authors ago
I have dome about 1200 filenames painfully manually  _________________ They said the job couldn't be done,
With a smile on his face he tackled the job
That they said couldn't be done
And he couldn't do it! |
|
| Back to top |
|
 |
louwin Junior Member


Joined: 09 Jun 2007 Posts: 63 Location: Perth, Western Australia
|
Posted: Sun Apr 15, 2012 7:16 am Post subject: |
|
|
A few hours later and I'm still blown away by MVV's solution
I read the MRT Help and included "Series" in my renames with a
[P], [N] - [G] Fabulous!
So I tried to further refine my requirement.
I did a ctrl + B to "explode" and ctrl + A to "select all". Then I did a Unselect Group "*.jpg" and a Unselect Group "*.gif" as I didn't want to rename the picture files.
I then wanted to Unselect all files with a pre-existing "space-dash-space" in their filenames. I tried Unselect Group * - *.* and *" - "*.* but they just unselected ALL the files
How do I Unselect all the files with a pre-existing "space-dash-space" in them?  _________________ They said the job couldn't be done,
With a smile on his face he tackled the job
That they said couldn't be done
And he couldn't do it! |
|
| Back to top |
|
 |
ehab Senior Member


Joined: 29 Oct 2007 Posts: 267 Location: Libya
|
Posted: Sun Apr 15, 2012 7:18 am Post subject: |
|
|
true, MVV does magic. _________________ #181344 Personal licence |
|
| Back to top |
|
 |
mhe Junior Member


Joined: 16 Feb 2003 Posts: 60
|
Posted: Sun Apr 15, 2012 8:24 am Post subject: |
|
|
Try unselect group, define, write " - " in the search (with the quotes) save, use what you just saved with unselect group.
Not entirely sure if it works, just tried quickly but think it does what you need. |
|
| Back to top |
|
 |
MVV Power Member


Joined: 03 Aug 2008 Posts: 4534 Location: Russian Federation
|
|
| Back to top |
|
 |
louwin Junior Member


Joined: 09 Jun 2007 Posts: 63 Location: Perth, Western Australia
|
Posted: Sun Apr 15, 2012 9:44 am Post subject: |
|
|
Brilliant.
Thanks MVV and mhe
Now I can refine my file selection before the final rename  _________________ They said the job couldn't be done,
With a smile on his face he tackled the job
That they said couldn't be done
And he couldn't do it! |
|
| Back to top |
|
 |
|