[feature suggestion] regular expressions in multirename-tool

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
bago
Member
Member
Posts: 102
Joined: 2003-02-05, 12:18 UTC
Location: Italy
Contact:

[feature suggestion] regular expressions in multirename-tool

Post by *bago »

It would be helpful to have regular expression match/substitution pattern integrated in multirename tool. :idea:

how often renaming files in the form XX - SongName - ArtistName.mp3 and you want Artist before the Songname? :?:

Well, with regexp (PCRE) you simply need to search ([0-9]+ - )([^-]+) - ([^\.]+).mp3 and replace it with $1$3 - $2.mp3. :D

It could seem complicated but every PCRE's fan would kill for this :twisted:
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48097
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Until now, I haven't added regular expressions because I think that they are too complex for the average user. Even I have to look up these options quite often because the syntax isn't very clear. :(
Author of Total Commander
https://www.ghisler.com
User avatar
fabiochelly
Power Member
Power Member
Posts: 603
Joined: 2003-02-05, 12:03 UTC
Location: Rambouillet, France

Post by *fabiochelly »

It's would be very useful I think to implement regular expressions: it's less complicated than DOS jokers and much more powerful.

Systools (which is opensource now) includes a regex engine: very easy to implement.
Fabio Chelly.
#60241
Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
User avatar
Ergo
Senior Member
Senior Member
Posts: 204
Joined: 2003-02-05, 12:20 UTC
Location: Belarus
Contact:

Post by *Ergo »

What use of regular expressions in search box? It wuold has use only in search & replace tasks. IMHO.
Wincmd.ru WWW.TOTALCMD.NET
I see that future is near...
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

2ghisler(Author)
An average user (and everybody who's below this rank) just won't use it. Similarly, one can still use Find Files dialog to find files even without knowledge of special symbols * and ?.
User avatar
Ergo
Senior Member
Senior Member
Posts: 204
Joined: 2003-02-05, 12:20 UTC
Location: Belarus
Contact:

Post by *Ergo »

What use of regular expressions in search box? It wuold has use only in search & replace tasks. IMHO
Sorry I was not attentive enough and missed "multirename-tool" in topic caption :)
An average user (and everybody who's below this rank) just won't use it.
I agree.
Wincmd.ru WWW.TOTALCMD.NET
I see that future is near...
scannert
Junior Member
Junior Member
Posts: 7
Joined: 2003-02-07, 23:04 UTC

Post by *scannert »

for me regular expressions are much easier to understand and use than the current [tags] while using the multi-rename tool.
I can't think of any reason on what type of rename operations where I can use the tags currently available with it.

I would too love to see regular expression support since I too rename very much mp3 files.
I even would like to suggest a savelist for multiple regexp to make it a bit easier if you only know the basics.

for example I have the following directories:

Adam_Beyer_and_Henrik_B-Year_Of_Reflection-Vinyl-2002-UTE
Alicia_Keys-Girlfriend_(KrucialKeys_Video_Version)-2002-BLEH
Anouk-Graduated_Fool-CD-2002-3G
Tenacious_D-Tribute-CDS-2003-3G

I would like to rename them all to:

Adam Beyer and Henrik B - Year Of Reflection vinyl (2002)
Alicia Keys - Girlfriend (KrucialKeys Video Version) (2002)
Anouk - Graduated Fool (2002)
Tenacious D - Tribute single (2003)

so I would have a savelist of regexp that would look like this and goes through from 1 till the end:

1. replace ^(.*)-(.*)-(.*)-([0-9]{4})-.* with $1 - $2 $3 ($4)
2. replace ^(.*)-(.*)-([0-9]{4})-.* with $1 - $2 ($3)
3. replace Vinyl with vinyl
4. replace CD with <empty string>
5. replace CDS with single
6. replace / +/ with / / (multiple spaces with only 1 space)

Very nice would even be that I can select which regexp numbers I want to use that session.

Reason I ask is that currently I have about 300 lines of regexps writting in a php script. I do under dos prompt a "dir /b >dirlist.txt", enter the contents in a sendform and let it go through my php script that outputs the contents for a msdos batch file that renames it how I want it renamed.

:) it works like a charm... hehe
but if it could be done from within tc... man! It would rock!
User avatar
bago
Member
Member
Posts: 102
Joined: 2003-02-05, 12:18 UTC
Location: Italy
Contact:

Post by *bago »

ghisler(Author) wrote:Until now, I haven't added regular expressions because I think that they are too complex for the average user.
Total Commander users are NOT average users: average users like "explorer" and the standard shell interface... why should they use TC?

We are POWER 8) users!
ghisler(Author) wrote:Even I have to look up these options quite often because the syntax isn't very clear. :(
You personally don't know well PCREs, but many many power user do, and they think with regexps too :?:

regular expression is very easy once "understood", and very powerful for this! It's like the "vi" editor: it is unusable to the average user but power users listen to mp3s too with it (joking).

PCREs (Perl Compatible Regular Expression) are very diffused and used by other programs: many editors, under windows too, already let search&replace by PCRE.

PCRE: you need 2 days to learn them, you gain 2 month of your life by using them :!:
apz
Junior Member
Junior Member
Posts: 9
Joined: 2003-02-08, 01:12 UTC

Post by *apz »

1. regular expressions are always nice to have, though, as valentino points out, 99% of people barely know how to use aa??bb.* type of searches.
2. why dont you look at a tool that does mp3 renaming based on id3 tags? you will save yourself tons of headaches
User avatar
bago
Member
Member
Posts: 102
Joined: 2003-02-05, 12:18 UTC
Location: Italy
Contact:

Post by *bago »

apz wrote:1. regular expressions are always nice to have, though, as valentino points out, 99% of people barely know how to use aa??bb.* type of searches.
99% of users: probably more...
well... I can tell you that 99% of users doesn't know how to use TC, too
apz wrote: 2. why dont you look at a tool that does mp3 renaming based on id3 tags? you will save yourself tons of headaches
Well, I do this: but you won't use multirename tool, lister, plugins if you use external tools. File compare, Dir compare, Renaming, SFV Check, FTP all this can be done with external tools but if they were not in TC I won't use it :!:

Again :arrow: if you never used a feature you don't know how much it is usefull. You can do without CTRL-D until you begin to use it. You can do without PCREs if you never learned them.
User avatar
pdavit
Power Member
Power Member
Posts: 1529
Joined: 2003-02-05, 21:41 UTC
Location: Kavala -> Greece -> Europe -> Earth -> Solar System -> Milky Way -> Space
Contact:

Post by *pdavit »

>bago
> well... I can tell you that 99% of users doesn't know how to use TC, too

Wow!!! Easy tiger! ;)


I vote for regular expressions too. Although I have to admit that the multirename-tool as it is now completes my needs 90% of the cases. It’s good to know though that for the remaining 10% of the case, if regular expressions are to be implemented, I will not have to follow side-methods to complete a task.

As far as the complexity concerned... well, there’s always a way to encapsulate the advanced features from normal users.
Last edited by pdavit on 2003-02-08, 22:17 UTC, edited 1 time in total.
"My only reason for still using M$ Window$ as an OS is the existence of Total Commander!"
Christian Ghisler Rules!!!
User avatar
bago
Member
Member
Posts: 102
Joined: 2003-02-05, 12:18 UTC
Location: Italy
Contact:

Post by *bago »

pdavit wrote:As far as the complexity concerned... well, there’s always a way to encapsulate the advanced features from normal users.
It could be an INI feature or a flag in the renametool.

And as scannert said it could allow to save, load, apply a set of PCREs with few keys.

Probably there are already PCRE or regexp sources/libraries available around :?: so the complexity would not be an issue: I can offer my help if needed 8) .
albel
Junior Member
Junior Member
Posts: 8
Joined: 2003-02-05, 20:08 UTC
Location: Moscow, Russia

Post by *albel »

The feature offered looks nice! But I fully agree it'd be better to for it be an INI feature or a flag in the renametool
User avatar
JackFoo
Senior Member
Senior Member
Posts: 373
Joined: 2003-02-05, 19:53 UTC
Location: ERROR

Post by *JackFoo »

And thou shall lie what is yours on the altar of Regular Expression and Macros...
I'm all for it, IMO those two features are THE most important for the next "large" release.

Cheers.
User avatar
pdavit
Power Member
Power Member
Posts: 1529
Joined: 2003-02-05, 21:41 UTC
Location: Kavala -> Greece -> Europe -> Earth -> Solar System -> Milky Way -> Space
Contact:

Post by *pdavit »

I agree with JackFoo too!

Yes I had a thread on the old forum asking for macros as well in addition to a log file.

I personally think that if such a powerful tool as TC is, is to be combined with macros to automatically perform a series of file managing tasks then the resulted application will become unbeatable!!! ;)
"My only reason for still using M$ Window$ as an OS is the existence of Total Commander!"
Christian Ghisler Rules!!!
Post Reply