Page 97 of 108

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Mon Nov 27, 2017 3:42 am
by Spix
Thank you for your quick response!

I'm not sure whether I got it:
I don't want to use a preset at all but just use regular expressions and I think I need regular expression 2 to move a (part of a) string from field Tittle to field Artist??
I tried with 2 capturing groups "(.*)" but with the same result:

Find what: "(.*) - (.*)" | Into: Artist | Regular expression 1: marked | without "Full" and "Find whole words only"
Original: "Unknown Artist"

Replace with: "$2" | From: Title | Regular expression 2: marked | without "Full", "VBScript", "Match case", "Backward search direction"
Replacement: "myTitle - myBand"
Result: "Unknown Artist"


Best regards
Spix

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Mon Nov 27, 2017 12:52 pm
by ZvezdanD
Copying a (part of a) string from a source to destination field modifies only destination field, so it could be done using a single preset's settings. However, moving a (part of a) string from a source to destination field requires modification of both fields, source and destination, which is not directly supported by this add-on using a single preset's settings. If you want to modify several fields, you could do that most easily with several appropriate presets applied in sequence.

By the way, the donation-only version currently has 28 moving presets that modify both source and destination fields at once, including "Move the begin of <From Field> before leftmost specified string to <Into Field>".

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Tue Nov 28, 2017 7:04 pm
by Spix
Hi,

thank you for yours answer!

Still I don't understand, why my approach with regular expressions does not work (for the first part of moving, i.e. copying the artist to the artist field)!?
Do you have an idea why it is not working? I'm still interested to make it work with regular expressions!

For this special problem I found an easy solution with the help of "Auto-Organize of Files..." and "Auto-Tag from File..."

Best regards
Spix

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Wed Nov 29, 2017 2:00 am
by ZvezdanD
I don't understand why you don't want to use the predefined "Assign" preset that I mentioned, which already does what you want. Presets are nothing more than saved replacement settings, using regular expressions or not. So, if you want to know how its settings looks, you could just choose it from the Preset combo box.

By the way, the Usage section of the add-on's Web page contains explanation about the purpose of Find what/Replace with strings and how they could be used:
"The first control in the next (finding) group is the Find what combo box which is used to specify the string that we want to search for and/or to replace in the destination field.
...
The first control in the next (replacing) group is the Replace with combo box which could be used for specifying a string that we want to use for the replacement."

Now, think again what you want to replace and what you want to use as a replacement.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Sat Jan 27, 2018 1:47 pm
by beg
Hi,

I'd need your help again (I know, it's a weired one - working with LP tranfers..) I was looking a lot in the the presets but could not find something like "copy/appending the last number of characters from the right from one given tag to the beginning of another..)

I need to add the last character from Album to the beginning of tracknumber.

Old Tracknumber is: 1
Old Album is: xxxxA

New Tracknumber should be: A1

Since I am not really experienced with all the expressions and possible switches, please give a complete explenation of how to use/add what and where..

Thanks a lot!

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Sat Jan 27, 2018 3:56 pm
by ZvezdanD
beg wrote:I need to add the last character from Album to the beginning of tracknumber.
There is no single predefined preset in the current version that could do what you want, but you could use a batch with the following two presets:
1. "Copy specified number of characters from the end of <From Field> to <Into Field>..." with turned on "Append to the end of destination field";
2. "Move specified number of characters from the end to the begin of <Into Field>..."

Or, you could just modify the first mentioned preset to avoid using of batch:
Find what: <If Caption="Assign to the field" Value=0 ID=1>^.*<Else Caption="Append to:"><If Caption="the begin of field" Value=1 ID=2>^<Else Caption="the end of field">$<End If><End If>
Replace with: <If ID:1><Else>IIf(Len("$_") > 0 And Len(SetVar(0, <End If>Right(<From Field>, <Number Caption="Characters to copy" Value="1">)<If ID:1><Else>)) > 0, <If ID:2>GetVar(0) & <End If>"<String Caption="Separator" Value=" - ">", "")<If ID:2><Else> & GetVar(0)<End If><End If>

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Sat Jan 27, 2018 6:12 pm
by beg
Thank you very much for your help - I used the modified version which I saved and it worked great!

It's a pitty those rules are a bit tricky and/or I am to ignorant to learn them..

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Thu Feb 22, 2018 10:51 am
by moviemonkey
preset Abc [Xyz -> Abc does not work

(.+)\[([^\]]*)$ just remove [

so, Abc [Xyz -> AbcXyz

Can you make this work properly and work with () also?

like, Abc (Xyz -> Abc

And I like another preset that makes Abc (Xyz -> Abc (Xyz)

I tried change this alone, but couldn't

Thank you

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Sat Mar 03, 2018 7:21 am
by beg
I'd have another tricky one..
I need to manipulate about 2000 tracks splitting and moving information from one colume in two others.
The data in one column is like this:

Matriz E 2922, cat. 18246
Matriz 1027-1, cat. 18061
Matriz 1028, cat. 18061-1
Matriz 1176, cat. 18036, segunda versiĆ³n
Matriz 42, cat. 18009
Matriz E 3121, cal. -

I need to move the value between "Matriz" and "," in another column.
I need to move the value after "cat."in another column
Anything behind "cat. xx," remains.

It can be a several steps process. And I know how to get rid of the additional stuff like "Matriz" and so on, but I don't know how to split it.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Sat Mar 03, 2018 8:41 am
by ZvezdanD
beg wrote:I don't know how to split it.
There are several presets from the "Separated field parts" menu that you could try using ", " as separator, e.g. "Copy the begin of <From Field> before leftmost specified string to <Into Field>...".

You could also use presets from the "Partial manipulations" menu. For example, "Copy leftmost part of <From Field> between specified strings to <Into Field>..." with Opening string = "Matriz " and Closing string = ", ".

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Sat Mar 03, 2018 10:29 am
by beg
thank you, I managed with two of those presets - the hint for the "copy leftmost part of.." was very helpfull! I combined it afterwards with "remove leftmost part of.."

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Tue Mar 20, 2018 9:49 am
by beg
another question regarding this swiss army knife addon:

I am looking for a way to assign a hotkey doing the following example:

One track has a composer and an author correctly tagged.
Various other versions of the same recording do not have any information for composer and author.

I want to select those recordings and use the hotkey bound to RegExp function/batch which then copies the composer and the author from the recording having the information into all corresponding fields of the selected fields (being empty).

I know that I can copy field to field, but I don't know how to have one prefilled field copied into all the other fields being empty. It's what I do manually at the moment marking all tracks and set the check-box to use the info of one field to be used for all. But since I have to do this many thousand times, I'd prefer to have that function on a shortcut. Is it possible using this script?

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Tue Mar 20, 2018 10:26 am
by ZvezdanD
beg wrote:I want to select those recordings and use the hotkey bound to RegExp function/batch which then copies the composer and the author from the recording having the information into all corresponding fields of the selected fields (being empty).

I know that I can copy field to field, but I don't know how to have one prefilled field copied into all the other fields being empty.
I am not sure what you want, I think you have some typos in your post (fields instead of files). Do you want to copy the Composer field from one file to the other files? It is not so easy since this add-on is based on individual files, i.e. the content of one file cannot be used in other files directly. Maybe you could try with "Assign Artist if it is empty with value assigned to most tracks from same album" from the "Based on related files" menu, then choose "Composer" from the Into combo box and replace all "Artist" occurrences with "Author" inside the Replace with string.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Tue Mar 20, 2018 10:45 am
by beg
Thx for your fast reply. this get's a bit tricky for me. Not sure if this preset works as it says that tracks should have the same album title, but I'd need it to work across various ablums.

I'll try to explain my use case differently:

Title xy - Album 1 - Artist 1 - Composer: XY - Author: XY
Title xy - Album 2 - Artist 2 - Composer: empty - Author: empty
Title xy - Album 3 - Artist 3 - Composer: empty - Author: empty

I want to select those three and have the data from Composer and Author copied into all other tracks not having a composer and author set.
(Actually I also need this to work for the columns "Original Artist" and "Original Title" which I am using for disc and matriz numbers, but hopefully this would work the same?)

Anyway I it need to work across various albums.

It is basically the function the check boxes next to the fields in the edit properties window is providing - just without getting into properties, choosing the correct tab, checking the corresponding checkboxes and apply the settings. I am looking for a shortcut to do this.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Tue Mar 20, 2018 11:21 am
by ZvezdanD
beg wrote:I want to select those three and have the data from Composer and Author copied into all other tracks not having a composer and author set.
First of all, the Composer field is the same as the Author field since MediaMonkey uses a single field for that in the Songs table. Secondly, as I said, this add-on cannot copy the field's content of one file to the other files directly.

However, you could manually copy Composer from the file that has that field already entered, then select all files with that field empty and use the preset "Assign specified string to <Into Field>...". If you want to be sure to not select and overwrite the files that already have entered the Composer field, you could modify the mentioned preset by replacing the Find what string with the "^$" or simply choose Empty from the combo box on the left side of the Into combo box.