New JavaScript + Regex Assistant for Bulk Rename Utility

Javascript renaming examples. Javascript renaming is supported in version 3 or newer.

New JavaScript + Regex Assistant for Bulk Rename Utility

Postby Admin » Mon Jun 02, 2025 9:13 am

--------------------------------------------------------------------------------------------
New JavaScript + Regex Assistant for Bulk Rename Utility!

Try today the new powerful JavaScript + Regex Assistant for Bulk Rename Utility

Simply enter your renaming task and click on “Generate JavaScript” to create the JavaScript code, then copy and paste it into the JavaScript Renaming function of Bulk Rename Utility.
The assistant knows about all the functions and variables available to Bulk Rename Utility (see the help file in Bulk Rename Utility for details).

Alternatively, you can set the assistant to output a Regex to use in Bulk Rename Utility RegEx (1).


Try it today here: https://www.bulkrenameutility.co.uk/js/


Set the assistant to ‘Deep Think’ for high intelligence—you can also ask it to include comments.

Example Renaming Tasks:

  • Add a Prefix:
    Add “IMG_” to the beginning of every selected file name.
    Example input to assistant: “Add prefix ‘IMG_’ to all files.”
    Try this example
    Try this example (Regex)

  • Replace Spaces with Underscores:
    Change all spaces in file names to underscores.
    Example input to assistant: “Replace spaces in file names with underscores.”
    Try this example
    Try this example (Regex)

  • Convert to Lowercase:
    Make every file name entirely lowercase (keeping the extension unchanged).
    Example input to assistant: “Convert all file names to lowercase.”
    Try this example
    Try this example (Regex)

  • Pad Number Sequences:
    Find numeric parts and pad them to three digits (e.g., “file_1.txt” -> “file_001.txt”).
    Example input to assistant: “Pad all numbers in file names to 3 digits with leading zeros.”
    Try this example

  • Remove a Substring:
    Remove the substring “Draft_” from every file name if present.
    Example input to assistant: “Remove ‘Draft_’ from all file names.”
    Try this example
    Try this example (Regex)

  • Change File Extensions:
    Convert all “.jpeg” extensions to “.jpg” while leaving the base name intact.
    Example input to assistant: “Change extension from .jpeg to .jpg.”
    Try this example

  • Extract and Reorder Date:
    If file names contain a date like YYYYMMDD at the end (e.g., “report20250525.doc”), move it to the front (= “20250525_report.doc”).
    Example input to assistant: “Extract date YYYYMMDD at end of name and move it to the front, separated by an underscore.”
    Try this example

  • Append Timestamp:
    Append the current date and time (YYYY-MM-DD_HHMMSS) to each file name before the extension.
    Example input to assistant: “Append timestamp YYYY-MM-DD_HHMMSS before extension on each file.”
    Try this example

  • Swap Two Number Groups with RegEx:
    Given names like “Episode 10 - Title.mp4”, swap the episode number to always be two digits (= “Episode 01 - Title.mp4”).
    Example input to assistant: “Using regular expressions, find ‘Episode (\d+)’ and pad that number to two digits.”
    Try this example

  • Combine Folder Name into File Name:
    For each file, prepend its parent folder name and an underscore to the existing file name (e.g., “Vacation/IMG001.jpg” -> “Vacation_IMG001.jpg”).
    Example input to assistant: “Prepend parent folder name and underscore to each file name.”
    Try this example
Admin
Site Admin
 
Posts: 2923
Joined: Tue Mar 08, 2005 8:39 pm

Return to Javascript Renaming