![]() ![]() |
Apr 16 2004, 10:46
Post
#1
|
|
![]() Moderator Group: Moderators Posts: 5503 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
1. How do I create a new action?
2. How do I change upper/lower case of tag-fields or filenames? 3. How do I replace the string "xyz" in tag-fields or filenames? 4. How do I append the string " xyz" to the content of a tag-field? Examples:
|
|
|
|
Apr 16 2004, 11:22
Post
#2
|
|
![]() Moderator Group: Moderators Posts: 5503 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
How do I create a new action?
At first you have to create a new action group via Actions > Click on the button This action group can be applied to the selected files after you have added one or more actions to it. You can now create a new action in your action group via the button At the moment the following action types are available
This post has been edited by dano: Jul 16 2012, 12:50 |
|
|
|
Apr 16 2004, 11:40
Post
#3
|
|
![]() Moderator Group: Moderators Posts: 5503 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
How do I change upper/lower case of tag-fields or filenames?
Create a new action in an existing action group and choose Case conversion as action type. On field you can choose which parts of the tags/filename should be changed. Case conversion determines how the upper/lower case of the field will be changed. If you want for example mark chars after a left parenthesis or a hyphen as the begin of a word, enter the respective char under Words begin from/after any of. -------------------- |
|
|
|
Apr 16 2004, 12:09
Post
#4
|
|
![]() Moderator Group: Moderators Posts: 5503 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
How do I replace the string "xyz" in tag-fields or filenames?
Create a new action in an existing action group and choose Replace as action type. On field you can choose to which parts of the tags/filename the replace rule should be applied. On Original you enter the string that is due to be changed in field. On Replace with you enter the text that replaces the string in Original. If you leave it empty, the string will be deleted. -------------------- |
|
|
|
Apr 16 2004, 12:20
Post
#5
|
|
![]() Moderator Group: Moderators Posts: 5503 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
How do I append the string " xyz" to the content of a tag-field?
Create a new action in an existing action group and choose Format value as action type. In Field you can choose to which tag field the formatting rule should be applied. In Format string enter the placeholder for the field selected above and the string which should be appended. Example: If you want to append the string " xyz" to the current value of the comment field: Action type: Format value Field: COMMENT Format string: %comment% xyz You can use this also to add "xyz " in front of the tag value or to copy one value to another field. This post has been edited by dano: Feb 27 2010, 13:43 -------------------- |
|
|
|
Apr 16 2004, 13:50
Post
#6
|
|
![]() Moderator Group: Moderators Posts: 5503 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
Removing of strings
In order to remove strings, create a new action in an existing action group and choose Replace as action type. Field: Here you can enter which field(s) you want to change. You can choose _ALL, which affects tags AND filenames, _TAG which affects all tag fields, _FILENAME which only affects the filename or one of the other supported tag-fields. Original: Here you enter the string that you want to delete. Replace with: Leave it empty because you want to delete the string in Original. Example: The filename ThisShouldRemainREMOVETHIS should be replaced by ThisShouldRemain. Just enter REMOVETHIS in Original. Note: The replacement rules are first applied to the filename and afterwards to the file extension since version 2.13. This means that the period as separator between filename and file extensions must NOT be entered. In order to rename void.mp3 in v.mp3 you must not enter "oid." in Original. -------------------- |
|
|
|
Apr 16 2004, 14:28
Post
#7
|
|
![]() Moderator Group: Moderators Posts: 5503 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
Pasting of strings
Question: I want to paste spaces in the filename "Artist - Title" for better clearness and it should be like this: "Artist - Title". How does it work? Answer: Create a new action in an existing action group and choose Replace as action type. In the now opening dialog enter: In Field: "_FILENAME" In Original: " - " In Replace with: " - " You can activate the action group via Convert, But unwanted duplication of the spaces can occur if you want to execute this action several times. "x - x becomes x - x", and "x - x becomes x - x" etc. You can prevent this by adding a second action that makes " " (3 spaces) to " " (2 spaces). It is even more simple if your files are already properly tagged: you can use the converter This post has been edited by dano: Apr 6 2006, 07:43 -------------------- |
|
|
|
Apr 16 2004, 16:32
Post
#8
|
|
![]() Moderator Group: Moderators Posts: 5503 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
Removing of a certain number of leading chars
Question: I have some leading chars in the filename/tag. How can I remove them? Answer: Create a new action in an existing action group and choose Replace with regular expression as action type. In Field, choose where you want to remove the chars. In Regular expression enter ^.{3} if you want to remove 3 chars. Replace matches with stays empty. So you can enter the number of chars to be removed between the two curly brackets. To remove the last 3 characters use .{3}$ (Do not use this on _FILENAME) This post has been edited by dano: Jan 17 2010, 11:32 -------------------- |
|
|
|
Apr 16 2004, 17:05
Post
#9
|
|
![]() Moderator Group: Moderators Posts: 5503 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
Removing of certain leading chars
Question: Some titles start with "The", others with "Der" or "Die". But i can't just delete the 3 first chars because all other tags/filenames will be shortened, too. How can i remove only these chars? Answer: Create a new action in an existing action group and choose Replace with regular expression as action type. In Field, choose where you want to remove the chars. In Regular expression enter ^The\s+ Replace matches with stays empty. If you execute this action on your selected files, all The's and successional spaces will be deleted. Of course it works the same way with other words. -------------------- |
|
|
|
Apr 16 2004, 18:53
Post
#10
|
|
![]() Moderator Group: Moderators Posts: 5503 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
Remove/trim leading/trailing spaces
Video tutorial for these actions: http://www.vimeo.com/7756545 Leading spaces: Action type: Replace with regular expressions Field: _TAG Regular expression: ^\s+ Replace matches with: "^" matches the beginning of the string. Then "\s+" searches for all whitespaces till a different char occurs. The whitespaces found will be replaced by nothing, therefore deleted. Trailing spaces: Action type: Replace with regular expressions Field: _TAG Regular expression: \s+$ Replace matches with: This regular expression matches one and more (marked by +) spaces (marked by the \s specifier) at the end (marked by $) of a string. To remove trailing spaces in the filename, one must take care of the extension, too. Example: Action type: Replace with regular expressions Field: _FILENAME Regular expression: \s+\.([a-z0-9]{2,4})$ Replace matches with: \.$1 NEW: Since Mp3tag v2.36 you can also use this action to remove leading and trailing spaces from the filename: Action type: Format value Field: _FILENAME Formatstring: $trim(%_filename%) Cut two or more consecutive spaces to one: Action type: Replace with regular expressions Field: _ALL Regular expression: \s{2,} Replace matches with: " " This post has been edited by dano: Dec 8 2009, 13:50 -------------------- |
|
|
|
Apr 16 2004, 18:54
Post
#11
|
|
![]() Moderator Group: Moderators Posts: 5503 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
Remove/trim leading track numbers
Action type: Replace with regular expressions Regular expression: ^\s*\d+\s*-\s* Replace matches with: This regular expression removes the track number from "01 - Anything.." so that only "Anything..." remains. "^" matches the beginning of the string. Then any numbers of whitespaces "\s*" followed by numbers from 0-9. The \s*-\s* part removes the hyphen and any whitespace characters around it. This post has been edited by dano: Nov 18 2007, 12:50 -------------------- |
|
|
|
Apr 16 2004, 19:14
Post
#12
|
|
![]() Moderator Group: Moderators Posts: 5503 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
Separating strings that are written in one word
Question: I have titles that have no spaces between words (written in one big word). However, all words start with a capital letter, e.g., ThisIsTheTitle. Can Mp3tag separate the individual words and insert a space before every capital letter? Answer: Create a new action group, e.g., TagsLikeThese for the field you wish to edit (the example uses the TITLE field): Action type: Replace with regular expression Field: TITLE Regular expression: (\l)(\u) Replace matches with: $1 $2 [x] case-sensitive comparison or Regular expression: (\w|,)(?=\u) Replace matches with: $1 $2 [x] case-sensitive comparison This post has been edited by dano: Feb 1 2010, 18:23 -------------------- |
|
|
|
Apr 16 2004, 19:24
Post
#13
|
|
![]() Moderator Group: Moderators Posts: 5503 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
Upper case after an O' like O'Hugo
Question: There are irish/scottish names like O'Donnel, O'Leary etc, that all should be upper case. But you cannot use upper case in general after an ' because the following examples are wrong spelled then (That'S, Ain'T etc.). How can I only get upper case after an O'? Answer: Create a new action in an existing action group and choose Replace with regular expression as action type. Regular expression: O'(.{1}) Replace matches with: O'$upper($1) [x] case-sensitive comparison This post has been edited by dano: Nov 25 2011, 22:53 -------------------- |
|
|
|
Sep 11 2005, 13:13
Post
#14
|
|
![]() Moderator Group: Moderators Posts: 5503 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
How can I swap the contents of 2 tag fields?
Example how to swap TITLE and ARTIST: Create a new action in an existing action group or make a new action group. Action type: Guess values Source format: %title%~%artist% Guessing pattern: %artist%~%title% Note: The ~ sign is just used to make a separation between the two fields, you could take any other sign that does not appear in your fields, e.g. ¢ or an extended unicode character like ∞ or ∑ (v2.33 or higher required) keywords: swap swapping -------------------- |
|
|
|
Feb 10 2010, 14:19
Post
#15
|
|
![]() Developer Group: Admin Posts: 7621 Joined: 12-December 01 From: Germany, Dresden Member No.: 203 Mp3tag Version: 2.55a |
How can I copy one field value to another field?
Example how to copy the content of the ARTIST field to the ALBUMARTIST field: Create a new action in an existing action group or make a new action group. Action type: Format value Field: ALBUMARTIST Format string: %artist% Note: If you want to copy all possible values of a field (in case you have multiple artist fields), the internal scripting function $meta_sep can be used in the format string, e.g., $meta_sep(artist,\\) This post has been edited by dano: Dec 5 2010, 10:42 -------------------- |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 19th May 2013 - 23:24 |