Help - Search - Members - Calendar
Full Version: Few actions I can't figure out
Mp3tag Forums > Mp3tag - International > Support
djodjolyon
Hello,

I'm looking for actions I tried to find, unsuccessfully.


1. Manage fields
I want to put lots of information about a cd.
So, here is how I tried to do it :

1/ I put the informations in a text file. It looks like that:
Label : Makasound -
Producteur : Michael Ashley & Bob Marley -
Artist :
Vocals : Mikey Ras Starr -


2/ I import the text file in mp3tag in unsencedlyrics. So it looks like that:
eng||Label : Makasound -[square][square]Producteur : Michael Ashley & Bob Marley -[square][square]Artist :[square][square]Vocals : Mikey Ras Starr -

3/ I made the different fields, producteur, Artist etc.
So now, the goal is to put the right information in the right field.
I could make it for Label :
regular expression : (^|(.+))(Producteur\s:\s)(\w*)( -+(.+))
replace with : $4

The issue is that it doesn't work with the others because of the [square]
Have you any idea? I really hope there is a solution for that...


2. Rename directories
I have two problems with that.

My folder are like this :
Genre Folder > Artist Folder > Album Folder

I want to rename automaticaly the folders, not to create it (they already exists).
I'd like to rename the artist folder with the artist name, but I can't figure out how to do that...
And for the album folder, I would like it to be [year] Album
But I didn't find the way to put "[" and "]".


3. Advanced case feature
I want all the title in lower caps but I want to keep uppercase if there is 2 or more.
exemple :
I have : DLO SomethING Goes TO ffEE ThYE
I want : DLO somethING goes TO ffEE thYE


4. Just informations
Where is the part that explain how to use if function?


Thanks in advance
DetlevD
QUOTE (djodjolyon @ Jun 9 2008, 07:28) *
...1/ I put the informations in a text file. It looks like that:
Label : Makasound -
Producteur : Michael Ashley & Bob Marley -
Artist :
Vocals : Mikey Ras Starr -
...

I understand that you use the unsyncedlyrics field as a temporary storage to hold a list of values which you want to distribute into separated tag fields.

The list is a multiline string containing some carriage return sequences, which are displayed in grid view as square boxes, in Extended Tag View as line breaks.

In a first step you should get rid of those carriage return sequences. Replace them with some other human readable special character by using $replace() or regexp(), e. g.
- $replace(%UNSYNCEDLYRICS%,$char(13)$char(10),$char(124))
- $regexp(%UNSYNCEDLYRICS%,\r\n,|)

Afterwards use some fitting regular expression to fetch the data value from the string, e. g. for tag field producteur extract the text sequence from the list between "|Producteur : " and next following " -|" and you will get "Michael Ashley & Bob Marley", e. g.
$regexp(%UNSYNCEDLYRICS%,.*\|Producteur : (.+?) -\|.*,$1)

DD.20080609.1830.CEST
DetlevD
QUOTE (djodjolyon @ Jun 9 2008, 07:28) *
... I want all the title in lower caps but I want to keep uppercase if there is 2 or more.
exemple :
I have : DLO SomethING Goes TO ffEE ThYE
I want : DLO somethING goes TO ffEE thYE ...

Maybe this matches your need:
$regexp(%title%,\b(.\U),\l$1)

DD.20080609.2157.CEST
djodjolyon
Thanks for your help
QUOTE (DetlevD @ Jun 9 2008, 17:30) *
In a first step you should get rid of those carriage return sequences. Replace them with some other human readable special character by using $replace() or regexp(), e. g.
- $replace(%UNSYNCEDLYRICS%,$char(13)$char(10),$char(124))
- $regexp(%UNSYNCEDLYRICS%,\r\n,|)
That works great. Cool...

But I tought it was going to be easy to do the regexp to move the information in it's field... It's not!
I tried for more than 2 hours. But I really can't find it.
Here is an image of my action to do the whole thing. You'll see better what I did.


The regexp only works for producer field but not for the others...
I don't know why...
Can you help me doing that please...

QUOTE
Maybe this matches your need:
$regexp(%title%,\b(.\U),\l$1)

That works vey well.
Thanks a lot.
DetlevD
QUOTE (djodjolyon @ Jun 10 2008, 06:09) *
... But I tought it was going to be easy to do the regexp to move the information in it's field... It's not!
I tried for more than 2 hours. But I really can't find it. ...

At first of all you have to make sure, that your input data is properly organized.

Each data line must follow the same data sequence mask.
In your case you have build one data line out of:
FieldName
Blank
Colon
Blank
FieldValue
Blank
Hyphen
CarriageReturn
Linefeed


See "Artist" line in your input file. There is an inconsistency in the data structure.

Your input text file should look like:
CODE
Label : Makasound -
Producteur : Michael Ashley & Bob Marley -
Artist :  -
Vocals : Mikey Ras Starr -



Run an actionsgroup:
- Load the file data into a temporary tag field.
- Make the data human readable (not so important).
- Make the data safe for processing.
- Format tag field values from data.
- Delete temporary tag field.

e. g.
Begin Actionsgroup TEST_DJO

Action #1
Actiontype 14: Import text file
Field: DJO_LIST
Filename: O:\TEST\DJO.TXT

Action #2
Actiontype 5: Format tag field
Field: DJO_LIST
Formatstring: |$regexp(%DJO_LIST%,\r\n,|)|

Action #3
Actiontype 5: Format tag field
Field: DJO_ARTIST
Formatstring: %DJO_LIST%

Action #4
Actiontype 5: Format tag field
Field: DJO_LABEL
Formatstring: %DJO_LIST%

Action #5
Actiontype 5: Format tag field
Field: DJO_PRODUCER
Formatstring: %DJO_LIST%

Action #6
Actiontype 5: Format tag field
Field: DJO_VOCALS
Formatstring: %DJO_LIST%

Action #7
Actiontype 5: Format tag field
Field: DJO_ARTIST
Formatstring: $regexp(%DJO_ARTIST%,.*\|Artist÷:÷(.*?)÷-\|.*,$1)

Action #8
Actiontype 5: Format tag field
Field: DJO_LABEL
Formatstring: $regexp(%DJO_LABEL%,.*\|Label÷:÷(.*?)÷-\|.*,$1)

Action #9
Actiontype 5: Format tag field
Field: DJO_PRODUCER
Formatstring: $regexp(%DJO_PRODUCER%,.*\|Producteur÷:÷(.*?)÷-\|.*,$1)

Action #10
Actiontype 5: Format tag field
Field: DJO_VOCALS
Formatstring: $regexp(%DJO_VOCALS%,.*\|Vocals÷:÷(.*?)÷-\|.*,$1)

Action #11
Actiontype 9: Remove fields
Fields to remove (semicolon separated): DJO_LIST

Note: Replace one special character ÷ with one space character.
End Actionsgroup TEST_DJO (11 Actions)


The above procedure creates three tag fields:
DJO_LABEL ...: Makasound
DJO_PRODUCER : Michael Ashley & Bob Marley
DJO_VOCALS ..: Mikey Ras Starr


Be aware about the fact, that an empty field value does not create a tag field.
DJO_ARTIST has not been created.

DD.20080610.0732.CEST
djodjolyon
Hi,

I nearly finished what I wanted... It works well but I need one thing to simplify it.

I have that:
Format value
Field : MUSICIENS
Format : $regexp(%MUSICIENS%,^\|{2}(.*?),$1)

I would like to apply this regex to many fields but not all.
Is it possible with the regex or I have to do the same action many times?



And one other thing...
I need an action to switch word sequencies in the field Musicians.

Here is how the field look like :
||Musiciens :| > (Vocals) : Mikey Ras Starr| > (Drum) : Mickey mouse| > (Chorus) Le dromadaire
And I want to have something like that :
||Musiciens :| > Mikey Ras Starr (Vocals)| > Mickey mouse (Drum)| > Le dromadaire (Chorus)
I just want to switch the instrument and the artiste name.

The expression I made work perfectly if there is only one artist, but when I apply it to many artists, it just become mad!!
It gives something like that :
||Musiciens :| > Mickey mouse (Vocals) : Mikey Ras Starr| > (Drum)| > (chorus) Le dromadaire
Here is one of the many expression I made (but didn't work sad.gif ):
regex : (\(.+\))\s*:\s*(.+)\|
replace : $2 $1|

When I have finished, I'will put everything I've done!
Big thanks DetlevD wink.gif
DetlevD
QUOTE (djodjolyon @ Jun 10 2008, 20:04) *
... Format : $regexp(%MUSICIENS%,^\|{2}(.*?),$1)
I would like to apply this regex to many fields but not all.
Is it possible with the regex or I have to do the same action many times? ...

Think about organizing your data to simplify your work before coming into such situation.
I think you have to do one action for each tag field.
Discover meta tag field _TAG and try out if it can support to realize what you want.


QUOTE (djodjolyon @ Jun 10 2008, 20:04) *
...
I need an action to switch word sequencies in the field Musicians. ...
I just want to switch the instrument and the artiste name. ...

Look at your data (inconsistent structure):
CODE
||Musiciens :| > (Vocals) : Mikey Ras Starr| > (Drum) : Mickey mouse| > (Chorus) Le dromadaire


Look at this data (consistent structure) (added: space, colon, pipe):
CODE
||Musiciens :| > (Vocals) : Mikey Ras Starr| > (Drum) : Mickey mouse| > (Chorus) : Le dromadaire|


Use $regexp(%yourtagfield%,(\(.+?\)) : (.+?)\|,$2 $1|)

Result:
CODE
||Musiciens :| > Mikey Ras Starr (Vocals)| > Mickey mouse (Drum)| > Le dromadaire (Chorus)|


DD.20080611.0922.CEST
djodjolyon
QUOTE
Think about organizing your data to simplify your work before coming into such situation.
I think you have to do one action for each tag field.
Discover meta tag field _TAG and try out if it can support to realize what you want.

Yes of course I have to organize it. That's what I wanted to do...
I think Mp3tag do it wel!!


QUOTE
Look at your data (inconsistent structure):

This was normal! As I'm going to take the informations on the internet... I can have different structure.
Here it was just for the try.


QUOTE
Use $regexp(%yourtagfield%,(\(.+?\)) : (.+?)\|,$2 $1|)

I'll become crazy!!!! I tried many many times as usual. And it wasn't working just because one f****** character missing. mad.gif
Well thanks. I know for next time!


I finish the whole thing and I put all the stuff I did
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.