Alter file name

Discussion in 'Mac Programming' started by dukebound85, Jun 12, 2012.

  1. macrumors P6


    How would one go about changing

    v_2011-07-21.grib 2



    I have thousands of files this way and hard time manipulating them in NCL as *.grib will not process the files with the 2

    Thanks for any help!
  2. macrumors 603

    I don't know what NCL is.

    This shell pattern:
    will match filenames with or without a trailing " 2".

    It will also match other filenames, such as:

    To change a bunch of filenames, you should first identify what a safe new filename is. Is simply stripping the " 2" safe? has a number of file-renaming capabilities. Start there.

    Then you might look into two utilities: A Better Finder Rename, and NameChanger. There are others, google search terms: mac os x batch file rename
  3. macrumors member

    sed s/\ 2$//g

Share This Page