RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Postby ZvezdanD on Sat Apr 19, 2008 9:52 pm

Description:

This script works with MM 2.x and 3.x. It allows powerful finding and replacing of strings inside of selected/visible tracks in the tracklist window of your audio database. The matching criteria and the replacement string can be created using Regular expressions or VBScript expressions which provides very flexible transformations of data. Almost all MM fields are supported!

Download:

http://solair.eunet.rs/~zvezdand/RegExpReplace.htm

Image

What is new:

v3.6 - 2009-07-02
- Added: MapArrayEx and DateTimeISO custom functions.

v3.5.1 - 2009-06-18
- Fixed: error during start-up if none preset exists.

v3.5 - 2009-05-14
- Improved: skin styles;
- Fixed: load of empty and duplicated presets.

v3.4.3 - 2009-05-10
- Fixed: modifications of the Date and the Original Date fields.

v3.4.2 - 2009-04-14
- Fixed: saving of presets with localized versions of Windows.

v3.4.1 - 2009-02-25
- Fixed: Replace/Replace All for some presets (a bug introduced with the last update).

v3.4 - 2009-02-21
- Added: possibility to cancel Find Next/Replace All operations;
- Added: insert of the field name on the cursor position in the Replace with edit box (MM 3.1.0.1222 or up);
- Added: some new presets;
- Improved (bug): speed of the Replace All (drastically) when there are many unmatched tracks (bug).

v3.3 - 2009-02-02
- Added: auto-repeat for Up/Down buttons in the Export/Import dialog box with MM 3.1.0.1220 or up;
- Added: word-wrap option for display of presets in the Export/Import dialog box;
- Added: alphabetical sort of presets in the Export/Import dialog box by click on the table header.

v3.2 - 2009-01-20
- Improved: look of dialog boxes with some skins (custom configurable with CSS files);
- Improved: speed of selecting tracks for the main tracklist (drastically) and the Now Playing panel with MM 3.1.0.1214 and up;
- Added: some new presets (some old improved).

v3.1 - 2009-01-10
- Added: option to enable/disable display of the toolbar button for the last executed preset;
- Added: option to keep display of the toolbar button for the last executed preset after restart;
- Added: some new presets (some old improved);
- Fixed: detection when the Now Playing panel has a focus, even with MM3 older that 3.1.0.1210;
- Fixed: Select un/matched/Select to replace.

v3.0 - 2009-01-05
- Added: export/import/batch delete of presets;
- Added: option to display every checked preset as the toolbar button;
- Added: option to asign an icon to the preset item in the menu/toolbar (could be from external .ico file);
- Added: option for backward direction when finding matched tracks;
- Added: possibility to find/replace data in tracks from the Now Playing panel [MM3];
- Added: Day, Month, Date, Original Day, Original Month and Original Date fields (the old Date renamed to Year, the old Original Date renamed to Original Year; the new Date/Original Date accepts full date format YYYY-MM-DD) [MM3];
- Added: option to delete emptied folders when moving files as a result of the Path modification;
- Added/improved: the New button (old behavior when creating new presets is abandoned);
- Added: many new presets (many old improved);
- Improved: speed of Replace and Replace All when only few songs from a large list of songs should be updated;
- Fixed/improved: Select matched/Select to replace with large number of selected/visible tracks;
- Fixed: reading/writing presets from the .ini file with MM 3.1.0.1198 and newer (actually, the format of presets in the .ini file is changed);
- Fixed: truncated bottom buttons with some skins.

v2.2.2 - 2008-06-20
- Fixed: error "file not found".

v2.2.1 - 2008-06-19
- Added: synchronous display of current track in the table during navigation;
- Added: possibility for jump to current track by click on the corresponding row number in the table;
- Fixed: reset of the table after Replace command;
- Fixed: checked state of rows in the table after toggle with the "?" button;
- Fixed: merging new presets with old ones after installation for multi-user accounts.

v2.2 - 2008-06-14
- Added: possibility to check which tracks from the table should be replaced;
- Added: IfNull custom function for use with VBScript expressions;
- Added: many new presets (some old improved);
- Fixed: moving to the previous/next group of tracks (buttons |< and >|).

v2.1.2 - 2008-06-11
- Fixed: display of the new line characters in the string when used with the VBScript expression.

v2.1.1 - 2008-06-10
- Fixed: display and replacement of the new line characters in the string (Lyrics, Comment).

v2.1 - 2008-05-27
- Added: options to select all un/matched tracks in the tracklist (Sel. matched and Sel. unmatch.) [MM3];
- Added: options to keep only un/matched tracks, other tracks are removed from the tracklist (Keep matched and Keep unmatch.);
- Added: option to select all tracks that could be modified, i.e. old content is different than replacement (Sel. replace) [MM3];
- Added: option to keep only tracks that could be modified (Keep replace);
- Added: option to toggle between selected/visible tracks;
- Added: different highlight colors for matched tracks and for tracks that could be modified;
- Added: SQLQuery custom function for use with VBScript expressions;
- Added: many new presets (some old improved);
- Improved: response during a table refresh with time consuming expressions;
- Fixed: table with old/new content not updated after Replace All.

v2.0.1 - 2008-05-19
-Fixed: INI file with presets;
-Fixed: the ordinal number of tracks displayed in the table.

v2.0 - 2008-05-19
- Added: support for presets (Save, Delete, Move Up/Down) with many already predefined;
- Added: support for VBScript expressions for replacement;
- Added: the table with old/new display for defined number of selected/visible tracks;
- Added: highlighted display of matches;
- Added: Find what/Replace with dropdown lists with recently entered strings;
- Added: support for the progress bar and many other improvements.

v1.0.2 - 2008-05-07
- Fixed: updating tags into files.

v1.0.1 - 2008-04-25
- Fixed: error which is manifesting with double apostrophes inside of the field text.

v1.0 - 2008-04-19
- First public version.

Installation:
  • For MediaMonkey 3.x - just double-click on the RegExpReplace.mmip file; if you are on Vista make sure you have MM3 set to "Run as Administrator"; if you downloaded the installation package with IE7 and it changed its extension to a .zip, you should first change it back to a .mmip.
  • For MediaMonkey 2.x - rename a .mmip extension to a .zip, extract RegExpReplace.vbs and RegExpReplace.ini files to the MediaMonkey's "Scripts\Auto" folder and restart MM program.
Note: The RegExpReplace.ini file is used only after the installation. During its work, the RegExp Find & Replace script stores presets into the MediaMonkey.ini file.

Usage:

After installation, you will find a new option in the Edit menu of the MM program - RegExp Find and Replace. When you click on it, you'll get the same dialog box as it is in the screenshot from the top of this page. There are options similar to the almost any Find/Replace dialog in other programs, e.g. MS Word, but with extra additions of VBScript/Regular expressions. This means, if you don't turn on the option Regular expression, it will work almost as you expect. So, in the Find what text box you could enter string which you want to find inside of the MM field specified in the Into dropdown list, and after click on the Find Next button you should get the first track which contain matching criteria.

If you want to replace data in the founded track, you could enter some text in the Replace with text box (if you leave this box empty, the source data will be removed after using some Replace buttons, i.e. it will be replaced with the empty string). Contrary to the field in the Into dropdown list which always should be specified, the field inside of the From dropdown list is active only if you turn on the option Regular expression 2 or VBScript expression. This means, you could use string for replacements from existing MM fields only in combination with the VBScript/Regular expressions. But don't worry if you don't know Regular expressions - for the begin, all you should know is that you could specify .* if you want to use full string from some field.

This script doesn't support DOS/Windows file wildcards * and ?. Anyway, they are very limited in comparison to the possibility which you have using Regular expressions! For example, instead of * you could write .*, also instead of ? you could write .? and you would get almost same results.

Very important thing to know if you want to do some replacements is that a field specified with the Into dropdown list is a destination (to where replacement will take an effect), and a field specified with the From dropdown list is a source (from where you want to take a data). Maybe this is not so usual, because on many places you would find a source data area first and after that a destination, but this layout is here in use because such layout have almost all Find/Replace dialog boxes.

If you don't want to use some MM field for replacement, you could uncheck options Regular expression 2 and VBScript expression. In that case exactly same string entered in the Replace with text box will replace source data in all matched tracks if you click on the Replace All button. There is one exception for this - if you have checked the option Regular expression 1, you could specify $1, $2, ..., $xx tokens in the Replace with text box. In this case $1, $2... could not be used directly as replacement, so for example if you want to replace source string with $1 as the real text, you should specify double $ sign, i.e. $$1.

If you don't know too much about Regular expressions, here is some short explanation about this syntax. For example, if I want to swap the first and the last name of artists, I could specify "^(.+)\s(.+)$" in the Find what text box. Here we have two groups of expressions between parentheses - the first group is for the first name and the second is for the last name. So, if I want to swap this two groups, I need to specify "$2 $1" in the Replace with text box (if I enter "$1 $2", I will get same string as the source). As much as you have expressions surrounded by parentheses in the Find what text box, you could specify $nn tokens in the Replace with text box. If you don't want some expression to be used for replacements, but you need to put it inside of parentheses, you could specify "(?:expression)", where ?: is telling that this expression is not captured (numbered).

There are also some more "$" tokens which you could enter into Replace with text box, for example $&. This token substitute the text matched with the string from the field specified in the Into dropdown list. So, for example, if you enter "^.*" into Find what text box and "$&$&" into Replace with text box, you will get duplicated source string as a result of replacement (the option Regular expression 1 should be checked, and the Regular expression 2 should be unchecked). Of course, in previous examples you don't need to enter apostrophes ("") into text boxes - they are here as representation of the string.

Regular expressions are fairly complex for use and there are many sites on Internet which you could visit if you want to learn how to create them. For example, http://www.regular-expressions.info where you could find very nice tutorial about this.

Instead of using the Find Next button, you could manually browse your selected tracks with a help of |< and >| buttons and spinbox next to them. In the "Original" and "Result" textual areas, you would get displayed a result of possible string replacing for the current track. After you find a track which you want to change its data, you could click on the Replace button, and the script would transform string data for this track and try to find the next matching track, same as you get with the Find Next button. So, it is enough to click repeatably on the Replace button several times to replace string in all tracks which match specified criteria. If you are sure that all selected tracks contain string which should be replaced, you could use the Replace All button instead.

Maybe this is not obvious, so you should know that before you enter to the RegExp Find and Replace dialog box, you should first select tracks in the MM tracklist window for which you want to search or replace their data. If you don't select any track, this script will search/replace all tracks which are visible inside of the tracklist window. Please be very careful! If your tracklist has displayed all tracks from your database, after inappropriate usage of this script you could get undesired effect, i.e. corruption of your data. So, before any significant modification of data, please make a copy of the database first, especially in the begin until you get to be familiar with this script.

FAQ:
  • Q - When I start MM and open the RegExp dialog, the default preset is "0" and I can enter my new parameters there and save this as a new preset, which appears at the end of the list of presets. So, that works for creating one new preset. How do I create a second new preset? I don't see how to create an "empty" preset that I can modify and save.

  • A - OK. I changed a way for creating new presets in 3.0 version with added the New button - just click on it, type some text in the Preset field and set other parameters; after that you should click on the Save button.

    By the way, there are now two different ways to edit some existing preset:
    1. Edit / RegExp Find and Replace, then choose preset from the Preset dropdown list, edit it and click on the Save button.
    2. Edit / RegExp Export/Import, then click on the number of the needed preset from the # column, edit it and click on the OK button.

    If you want to create a new preset based on some existing one, you should use the RegExp Find and Replace dialog: choose initial preset from the Preset dropdown list, change its name and make necessary modifications on parameters; when you finish with them you should close this dialog box and enter it again (note number 0/xx in the Preset label), just after that you should click on the Save button and preset will be saved as a new, not overwriting the initial one.

  • Q - Is there a way to remove the toolbar buttons for "Increment Playcount" and "Decrement Playcount" on the toolbar? I don't use them and they just take up space.

  • A - Mentioned two presets have toolbar buttons just as an example (similar as the "Move prefixes ..." which have added keyboard Shortcut as an example). You could turn on/off toolbar buttons for any of the preset by checking on/off the Toolbar button option in the Find & Replace dialog box. So, if you want to remove those two initially installed toolbar buttons from the toolbar:

    1. Open the RegExp Find and Replace dialog box;
    2. from the Preset dropdown list choose preset "Increment play counter";
    3. turn off the Toolbar button check box;
    4. click on the Save button;
    5. from the Preset dropdown list choose preset "Decrement play counter";
    6. same as 3;
    7. same as 4.
Limitations:

This script could work only with one destination field (specified with the Into dropdown list). If you want a manipulation with several fields, you could try to do this with several steps (presets) or you should use some another script, e.g. ExtractFields.

There are some regular expressions which don't work correctly with Unicode characters, for example RegExp with \w, \W, \b, \B. This is because RegExp engine built in VBScript doesn't treat Unicode characters as letters. One solution is to use character range, so instead of \w you could write e.g. [\w\u0400-\u04FF] for Cyrillic or [\w\u0100-\u024F] for extended Latin.

Information about 3.0 version:

Beside of a possibility to export/import presets, main improvement is a new option to add/remove any preset to the toolbar as a new button. So, you could define as much toolbar buttons as they could fit on the window. Toolbar buttons with presets could display a textual caption or an icon. The caption with a name of the preset could be trimmed to the specified number of characters (Options dialog) and icon could be loaded from an external .ico file or some internal MM one (icons takes much less space than captions). You could assign an icon to some preset in the RegExp Find and Replace dialog choosing it from the Icon dropdown list. The external .ico file could be specified after click on the same dropdown control when the mouse has the pointer with the hand.

There is a separate RegExp-ID3_Genres-Sorted.ini file with 148 new presets which allow to assign specific genre to multi-item Genre field. Import of mentioned .ini file with genres is through RegExp Export/Import dialog box, but if you want to use it, before its import it could be better to first remove initially installed presets (you could always get them back with the import of the RegExpReplace.ini file). After that you should choose which presets/genres you want to show in the toolbar, because there are many of them. Adding/removing some preset to/from the toolbar should be done in the RegExp Find and Replace dialog box - you should select a needed preset from the Preset dropdown list, then turn on/off the Toolbar button check box and click on the Save button to remember that modification.

Now, with just a single click on the toolbar button you could assign a genre to all selected/visible tracks. There is also one more preset which removes last added genre from each track. With the new version you have a possibility to modify tracks not only in the main tracklist, but also in the Now Playing panel. Of course, instead of the genre you could assign some text to every other field after creating/modifying some preset.

This version has the changed format of presets stored in the .ini file. During installation you will be prompted if you want to convert your old presets to the new format. This is just a prevention from some specific situations, but in most cases you should choose Yes. After that you will be prompted if you want to add new sample presets. There are many new presets and many of the old presets are updated/improved. Because the script during installation checks only if the old preset names matches with new ones, maybe it would be better if you first uninstall old version of the script and when you get a dialog box with a question if you want to remove all settings, you should choose Yes. In such way you should have only new, improved presets after installation.

However, if you already have your own created presets, you should forget about this suggestion - just start installation and when you get a question if you want to add new sample presets you should choose No. After that you should open Edit / RegExp Export/Import dialog box, manually remove all old supplied presets (leave only your own presets) and after click on the File option you should specify RegExpReplace.ini file for the import. Sorry for inconvenience, but there is not any easier way if you want to get new improved presets (those which existed before) and to keep your own ones.

Information about 2.x version:

Old Examples section is removed from this post because the new version of the script has all this examples incorporated into RegExp dialog box in the form of presets. You could define, save or delete existing presets. You could start execution of some preset directly from the menu or from the toolbar, but also with a press on user-defined shortcut key.

Presets:

There are currently 101 already predefined presets (with addition of 148 presets for ID3 genres):
  • Replace underlines in the Path with spaces - Simple example how this script could be used very easily;
  • Replace acute/grave accent and single quotation mark with the apostrophe: Let´s -> Let's, I`m -> I'm, Don’t -> Don't;
  • Clear the Comment field - You could specify any field instead of the Comment, but please be careful;
  • Remove iTunes info from the Comment field;
  • Reset the Track Volume field - Set to default value as it was before analyzing tracks;
  • Adjust the maximal value of the Track Volume to 1.0;
  • Increment play counter - You could change the increasing value in the Replace with field;
  • Decrement play counter;
  • Assign the current date/time to the Last played field - Simple example for using of VBScript functions;
  • Copy the Date when the file is last modified to the Date added field - You could specify any field as a source or a destination;
  • Assign the date/time when the file is created to the Timestamp field - Timestamp is the date/time when a file is last modified;
  • Copy the release Date to the Original date only if it is undefined - Example of conditional replacing;
  • Copy the Artist to the Original Artist only if it is empty - Example of conditional replacing;
  • Add "The" prefix to the front of the Artist's name: Beatles -> The Beatles;
  • Remove prefixes from the Artist's name: The Beatles -> Beatles (works with multi-artists as well);
  • Move prefixes to the front of the Artist's name: Beatles, The -> The Beatles (works with multi-artists as well);
  • Move prefixes to the end of the Artist's name: The Beatles -> Beatles, The (works with multi-artists as well);
  • Copy the Artist name to the Custom 3 field with moved prefixes to the end - (works with multi-artists as well);
  • Swap the first and the last name of the Artist with added ', ': John Lee Hooker -> Hooker, John Lee (works with multi-artists as well);
  • Swap the last and the first name of the Artist with removed ', ': Hooker, John Lee -> John Lee Hooker (works with multi-artists as well);
  • Swap first two words of the Album: Side Dark of the Moon -> Dark Side of the Moon;
  • Swap the third and the seventh words of the Title - Just replace {2} and {3} with appropriate numbers if you want to swap another words;
  • Remove the timing marks from LRC lyrics: [00:13]E già -> E già;
  • Remove specified word and rest of the text until the end of the Lyrics;
  • Replace double blank lines from the Lyrics with the single ones;
  • Remove multiple blank lines from the Lyrics;
  • Remove leading and trailing blank lines from the Lyrics;
  • Remove leading and trailing spaces from each line of the Lyrics;
  • Remove multiple spaces from the Title;
  • Remove trailing/leading spaces from the Title;
  • Add spaces between words in the Title without spaces: AnotherBrickInTheWall -> Another Brick In The Wall;
  • Remove the track number from the begin of the Title: 03 - Time -> Time;
  • Add the track number to the begin of the Title: 3 (Track #) & Time (Title) -> 3 - Time (Title);
  • Add the track number with a leading zero to the begin of the Title: 3 (Track #) & Time (Title) -> 03 - Time (Title);
  • Remove leading zeros from the Track number: 03 -> 3; 003 -> 3;
  • Add the leading zero to the single-digit Track number: 3 -> 03;
  • Add leading zeros to get 3-digit Track numbers: 3 -> 003; 21 -> 021;
  • Increase the Track number by 100: 3 -> 103 (you could change the increasing value in the Replace with field;
  • Assign the ordinal number of the current track to the Track number - Auto-increment Track number (you could add starting value);
  • Add the ordinal number of the current track to the begin of the Title: 1 (#) & Allemande (Title) -> 1. Allemande (Title);
  • Add the ordinal number of the current track with a leading zero to the begin of the Title;
  • Add the ordinal number of the current track increased by 100 to the begin of the Title;
  • Assign the Disc number from the 3-digits Track number: 203 (Track #) -> 2 (Disc #);
  • Remove the disc number from the 3-digits Track number: 203 -> 03;
  • Assign the Disc number from the part of the Album name: Album (CD1) or Album [CD 1] or Album (Disc 1) or ... -> 1 (Disc #);
  • Remove the disc number from the Album name: Album (CD1) or Album [CD 1] or Album (Disc 1) or ... -> Album;
  • Assign the disc number to the Track number from the part of the Album name: Album (CD1) or [Disc 1] or ... and 03 (Track #) -> 103;
  • Assign the total number of tracks from the Track number to the Custom 1 field;: 3/12 (Track #) -> 12 (Custom 1);
  • Remove the total number of tracks from the Track number: 3/12 -> 3 (Actually, it removes all from / until the end of string);
  • Remove any six characters from the begin of the Album: (1973) Dark Side of the Moon -> Dark Side of the Moon;
  • Remove any six characters from the end of the Album: - Dark Side of the Moon (1973) -> Dark Side of the Moon;
  • Remove the year from the begin of the Album: (1973) Album or [1973] Album-> Album;
  • Remove the year from the end of the Album: Album (1973) or Album [1973] -> Album;
  • Assign the Artist name from the part of the Title: The Beatles - A Day in the Life -> The Beatles;
  • Remove the artist name from the Title - Actually, it removes anything on the front of the Title before " - ";
  • Add " (Live)" to the end of the Title: Time -> Time (Live) - (only if the Title is not empty);
  • Remove " (Live)" from the end of the Title: Time (Live) -> Time;
  • Remove all text from the comma till the end of the Artist name: Blood, Sweat & Tears -> Blood;
  • Replace (... remix/version/edit ...) with [ ... ] at the end of the Title - Only if mix/version/edit/... is between parenthesis;
  • Replace [... remix/version/edit ...] with ( ... ) at the end of the Title - Only if mix/version/edit/... is between brackets;
  • Assign (... remix/version/edit ...) from the end of the Title to the Custom 1:
  • Assign ( remix/version/edit ) from the end of the Title to the Custom 1 (version only):
  • Remove (... remix/version/edit ...) from the end of the Title:
  • Assign 6th and 7th characters from the Album to the Custom 5:
  • Add the Album name as the last item to the Custom 3 field - with a ';' as a separator;
  • Add "Art Rock" as the last item to the multi-valued Genre field: Rock; Prog-Rock -> Rock; Prog-Rock; Art Rock;
  • Remove the last item from the multi-valued Genre field: Rock;Prog-Rock;Art Rock -> Rock;Prog-Rock;
  • Replace "&", featuring, presents and versus with the "; " in the Artist name - you should check tracks before you choose Replace;
  • Copy featuring artists from the Title to the Artist field: Title feat. Artist1, Artist2 or Title (feat. Artist1, Artist2) or ... -> Artist feat. Artist1, Artist2;
  • Copy featuring artists from the Title to the Artist field and put them within [] brackets: Title feat. Artist1, Artist2 or ... -> Artist [feat. Artist1, Artist2];
  • Copy featuring artists from the Artist to the Title field: Artist feat. Artist1, Artist2 or ... -> Title feat. Artist1, Artist2;
  • Copy featuring artists from the Artist to the Title field and put them within [] brackets: Artist feat. Artist1, Artist2 or ... -> Title [feat. Artist1, Artist2];
  • Remove featuring artists from the end of the Title: Title feat. Artist1, Artist2 or Title [feat. Artist1, Artist2] or ... -> Title;
  • Remove featuring artists from the end of the Artist: Artist feat. Artist1, Artist2 or Artist [feat. Artist1, Artist2] or ... -> Artist;
  • Add featuring artists from the Artist field to the list of Involved people - Another example for VBScript expression with Regular expressions;
  • Add main artists with a collaboration from the Artist field to the list of Involved people;
  • Remove all featuring artists from the list of Involved people;
  • Remove all main artists from the list of Involved people;
  • Capitalize the Title (ASCII, Latin 1, Latin 2 & Cyrillic): ANotHer brIcK in tHe WaLl -> Another Brick In The Wall;
  • Capitalize the Title with exceptions (ASCII, Latin 1, Latin 2 & Cyrillic): ANotHer brIcK in tHe WaLl -> Another Brick in the Wall (you could specify words for exceptions);
  • Uppercase the first letter of each line or sentence of the Lyrics and lowercase others - if it have all characters in uppercase (ASCII, Latin 1, Latin2 & Cyrillic);
  • Uppercase English "I" and the first letter of each line or sentence of the Lyrics - You could add names which you want to be uppercased;
  • Uppercase only the first letter of each line or sentence of the Lyrics - Other characters remain unchanged (ASCII, Latin 1, Latin2 & Cyrillic);
  • Uppercase the first letter of each folder/filename of the Path (ASCII, Latin 1, Latin2 & Cyrillic): PiNk FLoyD\ThE WaLl\ANotHer brIcK in tHe WaLl -> Pink floyd\The wall\Another brick in the wall;
  • Convert an extension of the Path to the lower case - Filename.EXT -> Filename.ext;
  • Remove periods from the end of the file name: Track....mp3 -> Track.mp3;
  • Assign the first level folder of the Path to the Custom 2 field - You could change 1 in the Replace with to the appropriate folder level;
  • Move files to <Genre>\<Artist>\<Album>\<Track#> - <Title>.ext - Example how to combine several fields into one field;
  • Assign the Title to the filename of the Path;
  • Assign the Track number and the Title to the filename of the Path: 03 - Another Brick in the Wall -> filename;
  • Update the filename of the Path to ..\<Title> - <Artist> - <Album>.ext;
  • Add the Artist name to the front of the File name if it is not already there: Time.mp3 -> Pink Floyd - Time.mp3;
  • Assign the average Bitrate of the album to the last folder of the Path - Example for VBScript expressions with SQLQuery;
  • Assign the average album's rating to the Custom 3 field;
  • Assign the weighted Track volume of album's tracks to the Album volume - Another example for VBScript expressions with SQLQuery;
  • Fix common words (featuring, presents, versus);
  • Fix common words (I'm, I'll, don't, won't, ain't, isn't, can't) in the Title;
  • Remove diacritical marks from the Title (aeiou): áâăä -> a, éęëě -> e ...;
  • Remove diacritical marks from the Title (cdghjklnrstywz): çćĉċč -> c, śŝşš -> s ...;
  • Convert Cyrillic (Windows-1251) to Unicode - Extended character set with Serbian characters;
  • Convert Serbian Latin to Serbian Cyrillic: b -> б, v -> в ...

    Note: presets in Brown color are new in v3.0, Violet are new with v3.1-3.3 and Orange in v3.4.
Beside of searching for some specific string, this script could be used to change data, so please be very careful. Make a backup of the database before any serious modification.

If you have some interesting VBScript/Regular expression for data manipulation, please post it here.
Last edited by ZvezdanD on Sat Jul 11, 2009 6:54 pm, edited 33 times in total.
ZvezdanD
 
Posts: 1648
Joined: Fri Jun 09, 2006 12:40 am

Postby Bex on Sat Apr 19, 2008 9:56 pm

Cool! I'll check it out later! :)
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Bex
 
Posts: 5699
Joined: Fri May 21, 2004 10:44 am
Location: Sweden

Postby Teknojnky on Sat Apr 19, 2008 11:44 pm

Wow you just saved me alot of work, I was eventually gonna work on such a script if I ever finished up last.fm node. ;)

Thanks ZvezdanD!
Teknojnky
 
Posts: 5123
Joined: Wed Sep 07, 2005 4:01 am

Postby Teknojnky on Sun Apr 20, 2008 12:04 am

ahhh hehe I was looking at how to start the script but I eventually found it under the EDIT menu :)
Teknojnky
 
Posts: 5123
Joined: Wed Sep 07, 2005 4:01 am

Postby Bex on Sun Apr 20, 2008 12:09 am

Same here! :lol:
I had to look at the script code to find it.

ZvezdanD,
We want it as right click menu option! :D
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Bex
 
Posts: 5699
Joined: Fri May 21, 2004 10:44 am
Location: Sweden

Postby onenonymous on Sun Apr 20, 2008 12:57 am

Nice script!

Bex wrote:Same here! :lol:
I had to look at the script code to find it.

ZvezdanD,
We want it as right click menu option! :D

There's also a button on the Search toolbar.
onenonymous
 
Posts: 373
Joined: Sat Feb 02, 2008 6:09 pm
Location: Texas

Postby trixmoto on Sun Apr 20, 2008 8:02 am

Wow, looks like a pretty powerful script. I'm sure this will be very popular! :)
Loving the Monkey? - Get Gold
Check out my scripts at http://trixmoto.net including my top ten
Subscribe to my rss feed for all the latest news
trixmoto
 
Posts: 7913
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Postby ZvezdanD on Sun Apr 20, 2008 3:13 pm

Thanks folks for all kind words :)

The first post is updated with instructions about an installation and usage.
ZvezdanD
 
Posts: 1648
Joined: Fri Jun 09, 2006 12:40 am

Postby raybeau528 on Wed Apr 23, 2008 10:27 pm

Super useful!!! Just saved me from writing a single purpose script.

Ray
raybeau528
 
Posts: 401
Joined: Thu Sep 27, 2007 9:19 pm
Location: Connecticut

Postby Teknojnky on Thu Apr 24, 2008 6:56 pm

I was trying to a search and replace on ~750 tracks:

find \
replace

meaning I wanted to remove the "\" charcter.

When I selected replace all, I got the following error:

error #1025
expected end of statement
line 922, column 8


here is at least one example title which causes the above error

"Area 51" off of our 7\'\' rel

removing the \ should result in
"Area 51" off of our 7'' rel

note, the 7'' would be two apostrephies in this particular example

this error also happens when there are no matching 'find' strings

I am not using regex for either situation.
Last edited by Teknojnky on Thu Apr 24, 2008 7:44 pm, edited 2 times in total.
Teknojnky
 
Posts: 5123
Joined: Wed Sep 07, 2005 4:01 am

Postby Teknojnky on Thu Apr 24, 2008 7:00 pm

And a feature request: input history so the user does not have to remember previous find/replace strings. (but I assume this is not trivial to implement)

I would also suggest that the cancel button be re-worded to 'Close', since cancel implies that changes will be lost or reverted when pressed and since this does not seem to be the case, replacments already made will not be undone.

Also part II, a 'rewind to start of selected' button would be greatly useful when making multiple find/replaces on the same selection of files... it can get a bit annoying trying to click the previous button a few dozen or hundred times. :o
Teknojnky
 
Posts: 5123
Joined: Wed Sep 07, 2005 4:01 am

Postby ZvezdanD on Thu Apr 24, 2008 10:25 pm

Teknojnky wrote:When I selected replace all, I got the following error:
"Area 51" off of our 7\'\' rel

There was a problem with double apostrophes (") inside of the string. It is now resolved, please take a look on v1.0.1. Thank you very much for the report.
ZvezdanD
 
Posts: 1648
Joined: Fri Jun 09, 2006 12:40 am

Postby ZvezdanD on Thu Apr 24, 2008 10:41 pm

Teknojnky wrote:And a feature request: input history so the user does not have to remember previous find/replace strings.

I would also suggest that the cancel button be re-worded to 'Close',

a 'rewind to start of selected' button would be greatly useful

I already though about renaming Cancel to Close, but I saw that almost all MM dialog boxes has Cancel. Anyway, I changed that to Close in v1.0.1.

Other suggestions are already planed in similar form for the next version.
ZvezdanD
 
Posts: 1648
Joined: Fri Jun 09, 2006 12:40 am

Postby Teknojnky on Thu Apr 24, 2008 10:43 pm

Awesome! :)
Teknojnky
 
Posts: 5123
Joined: Wed Sep 07, 2005 4:01 am

Postby Davo on Fri Apr 25, 2008 2:39 am

Great script - I just noticed when i selected a Title field that in the "before" & "after" area it displays ampersands as underscores. eg Koerner, Ray & Glover becomes Koerner, Ray _Glover

David
Davo
 
Posts: 109
Joined: Wed Nov 07, 2007 2:00 am
Location: Australia

Next

Return to Need Help with Addons?

Who is online

Users browsing this forum: Ask Jeeves [Bot], Bex, Heartsbane, martialartsguy, Owyn and 11 guests