[feature suggestion] regular expressions in multirename-tool
Moderators: white, Hacker, petermad, Stefan2
[feature suggestion] regular expressions in multirename-tool
It would be helpful to have regular expression match/substitution pattern integrated in multirename tool.
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.
It could seem complicated but every PCRE's fan would kill for this
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.
It could seem complicated but every PCRE's fan would kill for this
- ghisler(Author)
- Site Admin
- Posts: 48097
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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
https://www.ghisler.com
- fabiochelly
- Power Member
- Posts: 603
- Joined: 2003-02-05, 12:03 UTC
- Location: Rambouillet, France
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.
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
#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
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!
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!
Total Commander users are NOT average users: average users like "explorer" and the standard shell interface... why should they use TC?ghisler(Author) wrote:Until now, I haven't added regular expressions because I think that they are too complex for the average user.
We are POWER users!
You personally don't know well PCREs, but many many power user do, and they think with regexps tooghisler(Author) wrote:Even I have to look up these options quite often because the syntax isn't very clear.
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
99% of users: probably more...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.
well... I can tell you that 99% of users doesn't know how to use TC, too
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 itapz wrote: 2. why dont you look at a tool that does mp3 renaming based on id3 tags? you will save yourself tons of headaches
Again 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.
- pdavit
- Power Member
- Posts: 1529
- Joined: 2003-02-05, 21:41 UTC
- Location: Kavala -> Greece -> Europe -> Earth -> Solar System -> Milky Way -> Space
- Contact:
>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.
> 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!!!
Christian Ghisler Rules!!!
It could be an INI feature or a flag in the renametool.pdavit wrote:As far as the complexity concerned... well, there’s always a way to encapsulate the advanced features from normal users.
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 .
- pdavit
- Power Member
- Posts: 1529
- Joined: 2003-02-05, 21:41 UTC
- Location: Kavala -> Greece -> Europe -> Earth -> Solar System -> Milky Way -> Space
- Contact:
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!!!
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!!!
Christian Ghisler Rules!!!