lcen.comlcen.comlcen.com

 
HOME PRODUCTS FAQ CONTACT 7/25/2017   
   
RENAMING EXAMPLES  
 
RENAMING EXAMPLES

FILE and MP3 Renamer - Renaming Examples and Reference

In general:

  • Make sure you get familiar with the controls, buttons, boxes, etc. To do this just hover you mouse over the "?" button, and labels will appear on top of every control.
  • All keywords (Format codes) are case sensitive and should be used in UPPERCASE.
  • If you feel unconfortable renaming your important files with a program you don't know yet, make a copy of them to a temporary folder and experiment with them.
  • If anything goes wrong, use the "Undo" button.
  • Files only get renamed and/or, in the case of MP3s, the internal tag gets modified.
  • Files will never be overwritten. If filenames collide, a number will be appended to the name to indicate that there's a duplicate, like this: (1)Filename.txt

Here are a few examples of the most common renaming tasks. You can do much more by combining the different keywords (Format Codes) in the proper places:




Renaming files, in the current folder (non-recursive), one file at a time, changing the extension:




Renaming files, in the current folder (non-recursive), all files at once, changing the extension:




Renaming files, in the current folder (non-recursive), all files at once, creating a "series" using <FOLDERNAME>, <PARENTFOLDERNAME> and <AUTONUMBER>:




Renaming files, in the current folder (non-recursive), all files at once, creating a "series" using <FILETIME>, <FILEDATE> and <AUTONUMBER>:




Renaming files, in the current folder (non-recursive), all files at once, replacing the string "AT" with "BX":




Renaming files, in the current folder (non-recursive), all files at once, removing the string "Test":




Renaming files, in the current folder (non-recursive), all files at once, setting a prefix with <PARENTPARENTFOLDERNAME>:




Renaming files, in the current folder (non-recursive), all files at once, setting a prefix with <LOCALDATE>:




Renaming files, in the current folder (non-recursive), all files at once, setting a suffix with <FILESIZE>:




Renaming files, in the current folder (non-recursive), all files at once, setting a suffix with <IMAGEMAKE> and <IMAGEDATE>:




Renaming files, in the current folder (non-recursive), all files at once, setting a suffix with <IMAGEDATE> and <IMAGETIME>:




Renaming files, in the current folder (non-recursive), all files at once, left-trimming until the string "st" is found:




Renaming files, in the current folder (non-recursive), all files at once, left-trimming a fixed number of characters, here 2:




Renaming files, in the current folder (non-recursive), all files at once, left-trimming to a maximum length, here 8:




Renaming folders, in the current folder (non-recursive), all files at once, setting a prefix with <FOLDERNAME>:




Renaming files, in the current folder (non-recursive), all files at once, renaming MP3s using the contained ID3v2, tags remain unchanged:

Advanced format box:

  • The default setting is "<PROPERCASE><TRY><ARTIST>|<MID>||1|-</MID></TRY></PROPERCASE> - <PROPERCASE><TRY><TITLE>|<MID>|-||</MID></TRY></PROPERCASE>". This long code can be separated in three main parts:
    • "<PROPERCASE><TRY><ARTIST>|<MID>||1|-</MID></TRY></PROPERCASE>" which means "try" to use the <ARTIST> field in the ID3 tag, if it's not found then parse (<MID>) the filename starting at the first character (1) until the character "-" is found. Then apply a "Proper Case" change to it. Example: From a filename "artist name - title.mp3", the following will be parsed: "Artist".
    • The separator " - ".
    • "<PROPERCASE><TRY><TITLE>|<MID>|-||</MID></TRY></PROPERCASE>" which means "try" to use the <TITLE> field in the ID3 tag, if it's not found then parse (<MID>) the filename starting after the character "-" has been found until the end of the filename (excluding the extension). Then apply a "Proper Case" change to it. Example: From a filename "artist name - title.mp3", the following will be parsed: "Title".
    • Note: Omitting the first argument of the <MID> function means that the filename should be parsed (without the extension).
  • You can change the advanced format as you like by moving, adding or removing the different BOX keywords (Format Codes) or other MP3 keywords. You can see the possible keywords by hovering your mouse over the advanced format box.



Renaming files, in the current folder (non-recursive), all files at once, upgrading to ID3v2 (if necessary), changing the case of the tags to "Proper Case" and finally renaming MP3s using the contained ID3v2:

Advanced format box:

  • The default setting is "<PROPERCASE><BOX1> - <BOX2></PROPERCASE>", which means "Proper Case" of the string in <BOX1>, which is the artist followed by the separator " - " and the string in <BOX2>, which is the title.
  • You can see which box is which by hovering your mouse over the "?" button.
  • You can change the advanced format as you like by moving, adding or removing the different BOX keywords (Format Codes) or other MP3 keywords. You can see the possible keywords by hovering your mouse over the advanced format box.



Renaming files, in the current folder (non-recursive), all files at once, mass setting the "Artist" field in the ID3v2 tag, the rest of the ID3 fields and the filename remain unchanged:




Advanced Renaming Tasks - Here are some example renaming tasks from our users:

>I have lots of files with the format
>Bowie, David - Jean Genie - ABCD001-10
>which I would like to change to
>David Bowie - Jean Genie - ABCD001-10
>How can this be done?

To do this:
1) Select the "Create Series" option in the "Operation Browser".
2) Select *.mp3 from the wildcard list.
3) Clear all boxes (Series name, Suffix, Prefix).
4) Enter the following in the "Series name" box (Copy/Paste to avoid typos):
<MID>|,||-</MID> <MID>||1|,</MID> - <MID>|-||</MID>

This long code can be separated in three main parts (if you don't want/need to understand the code, just skip to step 5):
-"<MID>|,||-</MID> " which means parse the filename starting after the character "," until the character "-" is found. Then use a space as separator.
-"<MID>||1|,</MID> - " which means parse the filename starting at the first character (1) until the character "," is found.
-"<MID>|-||</MID>" which means parse the filename starting after the character "-" has been found until the end of the filename (excluding the extension).
Note: Omitting the first argument of the <MID> function means that the filename should be parsed (without the extension).

5) Make sure that all files in the folder match the format you mentioned above, namely: "Bowie, David - Jean Genie - ABCD001-10". If not, use the wildcard box to filter only the files with the right format, for example like this: *,*-*.mp3
6) Click on the appropriate button to indicate that you want to rename all files.
7) Click on "Go" (the flag) to start renaming.



>My files are in the format
>Queen - Bohemian Rhapsody - ABC001-01.mp3
>I would like to use the filename contents to populate the ID3v2 fields
>ARTIST - TITLE - ALBUM-TRACK
>How can this be done?

This is a simple way to do this:
1) Select the "Mass Set ID3v2 Tag" option.
2) Check the proper boxes to enable them and enter the following (without the quotes):
-Proposed Artist: "<MID>||1|-</MID>"
-Proposed Title: "<MID>|-||-</MID>"
-Album: "<MID>|-|2|-</MID>"
-Track: "<MID>|-|3|</MID>"
Note: During this operation, you will not be able to see what will be parsed in from each field. To allow for this you can select the "Rename Manually" option and enter the codes one by one in the "New filename" box. In the "Proposed Name" column you will be able to see what will be parsed with each code. Use this to make sure that all codes parse the right part of the filename.

Explanation of the different formar codes (if you don't want/need to understand the code, just skip to step 3):
-"<MID>||1|-</MID>" means parse the filename starting at the first character (1) until the character "-" is found.
-"<MID>|-||-</MID>" means parse the filename starting after the character "-" has been found until another character "-" is found.
Note: Omitting the first argument of the <MID> function means that the filename should be parsed (without the extension).
-"<MID>|-|2|-</MID>" means parse the string from above starting after the second occurrence of the character "-" has been found until another character "-" is found.
-"<MID>|-|3|</MID>" means parse the string from above starting after the third occurrence of the character "-" has been found until the end of the filename (excluding the extension).

3) Now proceed to rename the file or files as usual.

Our example file will now have all tags set.




>My music collection is organized like this:
>C:\MP3\Artist Name\Album\Title.mp3
>How can I put this information in the ID3v2 fields?

1) Select the "Mass Set ID3v2 Tag" option.
2) Check the proper boxes to enable them and enter the following (without the quotes):
-Proposed Artist: "<PARENTFOLDERNAME>"
-Proposed Title: "<NAMEONLY>"
-Album: "<FOLDERNAME>"
3) Click on "Go" (the flag) to start the extraction process.




>How can I erase all the list numbers of songs from these files:
>U2 - 01. - Vertigo.mp3
>U2 - 02. - Desire.mp3
>So that they look like these:
>U2 - Vertigo.mp3
>U2 - Desire.mp3

To do this:
1) Select the "Create Series" option in the "Operation Browser".
2) Select *.mp3 from the wildcard list.
3) Clear all boxes (Series name, Suffix, Prefix).
4) Enter the following in the "Series name" box (Copy/Paste to avoid typos):
<MID>||1|-</MID> - <MID>|. -||</MID>

This long code can be separated in two main parts (if you don't want/need to understand the code, just skip to step 5):
-"<MID>||1|-</MID> - " which means parse the filename starting at the first character (1) until the character "-" is found. Then use " - " as separator
-"<MID>|. -||</MID>" which means parse the filename starting after the first occurrence of ". -" until the end of the filename (excluding the extension)
Note: Omitting the first argument of the <MID> function means that the filename should be parsed (without the extension)

5) Make sure that all files in the folder match the format you mentioned above, namely: "XY - ??. - XYZ". If not, use the wildcard box to filter only the files with the right format, for example like this: *-*. -*.mp3
6) Click on the appropriate button to indicate that you want to rename all files.
7) Click on "Go" (the flag) to start renaming.




>How can I rename MP3 files that look like these:
>"SC3212-05 - Fabian, Lara - I Will Love Again.mp3"
>"SC3212-05 - Madonna - Like A Prayer.mp3"
>so that they look like these:
>"SC3212-05 - I Will Love Again - Fabian, Lara.mp3"
>"SC3212-05 - Like A Prayer - Madonna.mp3"
>There is no id3 tag info available.

1) Select the "Create Series" option in the "Operation Browser".
2) Select *.mp3 from the wildcard list.
3) Clear all boxes (Series name, Suffix, Prefix).
4) Enter the following in the "Series name" box (Copy/Paste to avoid typos):
<MID>||1| - </MID> - <MID>| - |2|</MID> - <MID>| - || - </MID>

5) Now proceed to rename the file or files as usual, one by one or all at once.




>How can I rename MP3 files that look like this:
>"ezh011-01 - Holly Valance - Kiss Kiss.mp3"
>so that they look like this:
>"ezh011-01 - Kiss Kiss - Valance, Holly.mp3"
>There is no id3 tag info available.

1) Select the "Create Series" option in the "Operation Browser".
2) Select *.mp3 from the wildcard list.
3) Clear all boxes (Series name, Suffix, Prefix).
4) Enter the following in the "Series name" box (Copy/Paste to avoid typos):
<MID>||1| - </MID> - <MID>| - |2|</MID> - <MID>| |3| - </MID>, <MID>| - || </MID>

5) Now proceed to rename the file or files as usual, one by one or all at once.




>How can I create a directory according to a filename
>(the first characters before the first hyphen), and then move files
>into the respective folders?
>For example, for the file "ezh011-01 - Kiss Kiss - Valance, Holly.mp3"
>a folder would be created named "ezh011", then all files that begin with
>those letters would be moved into the folder.

1) Select the "Create Folder(s) using Filename Parts" option in the "Operation Browser".
2) Enter the following in the "Target folder" box (Copy/Paste to avoid typos):
<MID>||1|-</MID>

3) Click on the GO button to create the folders.
4) Select the "Move File(s)/Folder(s)" option in the "Operation Browser".
5) The same code from 2) should be in the "Target folder" box.
6) Click on the GO button to move the files into their respective folders.



 

'FILE and MP3 Renamer 2006 Scripting Reference

'Version 1.12
'© 1998-2006 L.C. Enterprises
'http://LCen.com

'Notes:
'Keywords, and functions are case sensitive.
'Do MP3 tag operations first, then rename operations.
'After "Operation Name", a title preceded by tabs comes. These tabs indicate
'the position in the tree. One tab is a root item.
'Mandatory settings: Help message, Available boxes and Box name.

'Syntax notes:
'<OPTIONAL STRING> means that a string is expected, but an empty string would
'also be accepted.
'<REQUIRED STRING> means that a string is expected and it should not be empty
'for the function to work properly.
'<OPTIONAL INTEGER> means that an integer is expected, but an empty string would
'also be accepted.
'<REQUIRED INTEGER> means that an integer is expected and needed for the
'function to work properly.

********************************************************************************
Operation format
********************************************************************************

Operation Name: <REQUIRED STRING>

Operation Name: <REQUIRED STRING>
Help Message: <REQUIRED STRING>
Available Boxes: <REQUIRED INTEGER>
Box Name: <REQUIRED STRING>
Box Display: <OPTIONAL STRING>[<PREFERBOX>]
Box ToolTip: <OPTIONAL STRING>
Step: <REQUIRED COMMAND>

********************************************************************************
Keywords
********************************************************************************

========================================
Box values
========================================
<BOX1> <BOX2> <BOX3> <BOX4> <BOX5> <BOX6>

Registry(<REQUIRED STRING REGISTRY VALUE NAME>[|<OPTIONAL STRING DEFAULT VALUE IF NOT FOUND>])
'The Registry() function retrieves the value from a registry value, an optional
'default value can be specified.
'If there is no default value, omit the "|".
'It is good practice to append the script version to the
'<REQUIRED STRING REGISTRY VALUE NAME> to avoid errors when new versions come up.
'Example for script version 1.12: SeriesName112

========================================
Special file values
========================================
<FILECREATIONTIME>
<FILECREATIONDATE>
<FILELASTMODIFIEDTIME>
<FILELASTMODIFIEDDATE>
<FILESIZE>
<LOCALTIME>
<LOCALDATE>
<FILENAME>
<NAMEONLY>
<EXTONLY>
<AUTONUMBER>
<FOLDERNAME>
<PARENTFOLDERNAME>
<PARENTPARENTFOLDERNAME>
Registry()

========================================
Special image values (EXIF Format)
========================================
<IMAGEMAKE>
<IMAGETIME>
<IMAGEDATE>

========================================
MP3 values
========================================
<ARTIST>
<TITLE>
<ALBUM>
<COMMENTS>
<TRACK>
<KBIT>

========================================
MP3 functions
========================================
<WriteID3v1>
<WriteID3v2>
<RemoveID3v1>

--------------
Syntax
--------------
<WriteID3v1><ARTIST>|<TITLE>|<ALBUM>|<COMMENTS>|<TRACK></WriteID3v1>

<WriteID3v2><ARTIST>|<TITLE>|<ALBUM>|<COMMENTS>|<TRACK>|<REQUIRED INTEGER REMOVE ID3v1></WriteID3v2>
'Remove ID3v1 can be 1 or 0, for yes or no respectively.

========================================
String manipulation functions
========================================
<MID>
<TRY>
<PROPERCASE>
<LOWERCASE>
<UPPERCASE>
<MAKEEXTENSION>
<REPLACE>
<LEFTTRIM>
<RIGHTTRIM>
<PREFERBOX_SINGLE>
<PREFERBOX_ALL>

--------------
Syntax
--------------
<MID>
'There are two different ways to call this function:
<MID><OPTIONAL STRING TO PARSE>|<REQUIRED STRING START PARSE>|<OPTIONAL INTEGER OCCURRENCE>|<OPTIONAL STRING END PARSE></MID>
'<OPTIONAL INTEGER OCCURRENCE> indicates where to start parsing in case <REQUIRED STRING START PARSE> occurs
'more than once in <OPTIONAL STRING TO PARSE>. If omitted, the first occurrence will be used. If there
'are less occurrences than the specified value, the last occurrence will be used.
'The value in <REQUIRED STRING START PARSE> will not be included in the returned string.

<MID><OPTIONAL STRING TO PARSE>||<REQUIRED INTEGER START PARSE>|<OPTIONAL STRING END PARSE></MID>
'If <OPTIONAL STRING TO PARSE> is omitted, <NAMEONLY> will be used as the string to parse.
'If <OPTIONAL STRING END PARSE> is omitted, the string will be parsed until its end.
'The value in <OPTIONAL STRING END PARSE> will not be included in the returned string.

<TRY><OPTIONAL STRING TRY>|<REQUIRED STRING ELSE VALUE></TRY>
'If <OPTIONAL STRING TRY> results in an empty string, <REQUIRED STRING ELSE VALUE> will be used.

<PROPERCASE><REQUIRED STRING></PROPERCASE>
'Will change a string to "Proper Case", "Proper. Case", "Proper (Case)" or "Proper - Case".

<LOWERCASE><REQUIRED STRING></LOWERCASE>
'Will change a string to "lower case".

<UPPERCASE><REQUIRED STRING></UPPERCASE>
'Will change a string to "UPPER CASE".

<MAKEEXTENSION><OPTIONAL STRING></MAKEEXTENSION>
'Will append the dot (.) to a string that will be used as an extension if necessary.

<REPLACE><OPTIONAL STRING TO REPLACE>|<REQUIRED SEARCH STRING>|<REQUIRED REPLACE STRING>|<OPTIONAL INTEGER OCCURRENCES></REPLACE>
'If <OPTIONAL STRING TO REPLACE> is omitted, <NAMEONLY> will be used as the string to replace.
'Occurrences: -1 or if omitted will indicate that all occurrences should be replaced.

<LEFTTRIM>
'There are three different ways to call this function:
<LEFTTRIM><REQUIRED STRING>|<REQUIRED STRING UNTIL FOUND>||</LEFTTRIM>
'Will trim the characters on the left of a string until a character or string is found,
'the part to find will appear in the returned string.

<LEFTTRIM><REQUIRED STRING>||<REQUIRED INTEGER NUMBER OF CHARACTERS>|</LEFTTRIM>
'Will trim a fixed number of characters to the left of a string.

<LEFTTRIM><REQUIRED STRING>|||<REQUIRED INTEGER MAXIMUM LENGTH></LEFTTRIM>
'Will trim the characters on the left of a string until a maximum length has been reached.

<RIGHTTRIM>
'There are three different ways to call this function:
<RIGHTTRIM><REQUIRED STRING>|<REQUIRED STRING UNTIL FOUND>||</RIGHTTRIM>
'Will trim the characters on the right of a string until a character or string is found,
'the part to find will appear in the returned string.

<RIGHTTRIM><REQUIRED STRING>||<REQUIRED INTEGER NUMBER OF CHARACTERS>|</RIGHTTRIM>
'Will trim a fixed number of characters to the right of a string.

<RIGHTTRIM><REQUIRED STRING>|||<REQUIRED INTEGER MAXIMUM LENGTH></RIGHTTRIM>
'Will trim the characters on the right of a string until a maximum length has been reached.

<ASCII><REQUIRED INTEGER 0-255></ASCII>
'Returns the ASCII character represented by the specified number between 0 and 255.

<OLDESTDATETIME><REQUIRED DATE AND/OR TIME 1>|<REQUIRED DATE AND/OR TIME 2></OLDESTDATETIME>
'Returns the oldest of the two specified dates and/or times.

<NEWESTDATETIME><REQUIRED DATE AND/OR TIME 1>|<REQUIRED DATE AND/OR TIME 2></NEWESTDATETIME>
'Returns the newest of the two specified dates and/or times.

<IMAGEEXIFTAG><REQUIRED EXIF TAG></IMAGEEXIFTAG>
'Supported Exif tags: ApertureValue, BrightnessValue, CFAPattern, ColorSpace.
'ComponentsConfiguration, CompressedBitsPerPixel, Copyright, DateTime.
'DateTimeDigitized, DateTimeOriginal, ExifImageHeight, ExifImageWidth.
'ExifInteroperabilityOffset, ExifOffset, ExifVersion, ExposureBiasValue.
'ExposureIndex, ExposureProgram, Exposuretime, FileSource, Flash.
'FlashPixVersion, FNumber, FocalLength, FocalPlaneResolutionUnit.
'FocalPlaneXResolution, FocalPlaneYResolution, ImageDescription.
'ISOSpeedRatings, LightSource, Make, MakerNote, MaxApertureValue, MeteringMode.
'Model, Orientation, PrimaryChromaticities, ReferenceBlackWhite.
'RelatedSoundFile, ResolutionUnit, SceneType, SensingMethod.
'ShutterSpeedValue, Software, SubjectDistance, SubsecTime, SubsecTimeDigitized.
'SubsecTimeOriginal, UserComment, WhitePoint, XResolution, YCbCrCoefficients.
'YCbCrPositioning, YResolution.

<VALUE OR FUNCTION>[<PREFERBOX_SINGLE>|<PREFERBOX_ALL>]
'This keyword will retain manual changes to a box when renaming files one by one,
'the manual changes will be preferred over the automatic value that could be
'generated or extracted from the file.
'The ALL version of the function does the same but when renaming all files at once.

========================================
Special file and folder functions
========================================
<CREATEFOLDER>
<MOVE>

--------------
Syntax
--------------
<CREATEFOLDER><REQUIRED FOLDER NAME></CREATEFOLDER>
'If a folder already exists or cannot be created, it will fail silently.

<MOVE><REQUIRED TARGET FOLDER></MOVE>
'A part of a file name can be used as the value for <REQUIRED TARGET FOLDER>,
'for example the <ARTIST> value of an MP3 file. The file will be moved only if a folder
'with that name already exists.
'If a file or folder cannot be moved or if the target folder does not exist,
'it will fail silently.

 
 
Up | Home | Back
 
Last updated: 12/6/2006
 
 
Admin LCMS - Content Management System  © 1998-2017 L.C. Enterprises. http://LCen.com. All rights reserved. Privacy Policy.
11707