Batch truncating file names

Discussion in 'macOS' started by dwfaust, Sep 4, 2015.

  1. dwfaust macrumors 68040

    dwfaust

    Joined:
    Jul 3, 2011
    Location:
    I am here => [•]
    #1
    I am trying to rename a folder full of files (over 300 files) with names in the format:

    YYYYMMDD-something-descriptive-goes-here.mp3

    to

    YYYYMMDD.mp3

    All of the batch utilities that I've seen can add text or replace text, but so far I have not found one that will truncate text to a specific length. The ones that do remove text will only remove a set number of characters from either end of the file (beginning or end). In my case, these file names are variable in length, so they don't work.

    Any ideas?
     
  2. HenryAZ macrumors 6502

    HenryAZ

    Joined:
    Jan 9, 2010
    Location:
    South Congress AZ
    #2
    Better Rename will do this easily. Truncate file name only to x number of characters. As long as your date strings are a consistent set number of characters, easy. Just pick the 'Truncate' function.
     

Share This Page