[Solved] Rename folders

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Alexisback
Junior Member
Junior Member
Posts: 80
Joined: 2016-10-26, 20:04 UTC

[Solved] Rename folders

Post by *Alexisback »

Hello everyone
I would like to rename these folders :roll: :idea:
by so


2016-03-13 - SZ001 - Test1
2016-04-24 - SZ002 - Test2
2016-05-22 - SZ003 - Test3
2016-06-09 - GIO01 - Test4
2016-08-07 - GIO02 - Test5
2016-10-12 - SZ004 - Test6
2016-11-25 - IV001 - Test7
2016-12-16 - SZ005 - Test8
2017-02-12 - GIO03 - Test9
2017-04-03 - IV002 - Test10
2017-05-06 - GIO04 - Test11
........................
eccc.......

to so

SZ001 - 2016-03-13 - Test1
SZ002 - 2016-04-24 - Test2
SZ003 - 2016-05-22 - Test3
........................
eccc...........

can someone help me? :wink:

Thank you
Last edited by Alexisback on 2018-10-25, 05:19 UTC, edited 1 time in total.
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: Rename folders

Post by *Gral »

Multi rename tool

Code: Select all

Search for: (.+) - (.+) - (.+)
Replace with: $2 - $1 - $3
[x]RegEx
Alexisback
Junior Member
Junior Member
Posts: 80
Joined: 2016-10-26, 20:04 UTC

Re: Rename folders

Post by *Alexisback »

Gral wrote: 2018-10-24, 21:30 UTC Multi rename tool

Code: Select all

Search for: (.+) - (.+) - (.+)
Replace with: $2 - $1 - $3
[x]RegEx
it works, :D
can you explain the code to me? :wink:

Thank you so much :wink:
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: Rename folders

Post by *Gral »

It is explained in the TC help.
( mk:@MSITStore:TOTALCMD.CHM::/reg_ex.htm )

Code: Select all

Subexpressions for search+replace
 
Text parts in round braces are taken as subexpressions. Up to 32 subexpressions are supported now.
Example: To swap the title and interpret in the file name of an mp3 file, when they are separated by a dash (Title - Interpret.mp3), use the following options:
Search for: (.*) - (.*)\.mp3
Replace by: $2 - $1.mp3
Here $1 means the text in the first brace, and $2 the text in the second brace.
Alexisback
Junior Member
Junior Member
Posts: 80
Joined: 2016-10-26, 20:04 UTC

Re: Rename folders

Post by *Alexisback »

You
Search for: (.+) - (.+) - (.+)
TOTALCMD.CHM
Search for: (.*) - (.*)
:idea: :roll:

why this?

(.+)

and not this

(.*)
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: Rename folders

Post by *Gral »

Again - read help! - the same chapter.

Code: Select all

Iterators
 
Iterators are used for a repetition of the character or expression to the left of the iterator.
* zero or more occurrences
+ one or more occurrences
Alexisback
Junior Member
Junior Member
Posts: 80
Joined: 2016-10-26, 20:04 UTC

Re: Rename folders

Post by *Alexisback »

Gral wrote: 2018-10-24, 22:43 UTC Again - read help! - the same chapter.

Code: Select all

Iterators
 
Iterators are used for a repetition of the character or expression to the left of the iterator.
* zero or more occurrences
+ one or more occurrences
I understood now :)
Thank you so much for your help :wink:
Post Reply