PDA

View Full Version : Alter file name




dukebound85
Jun 12, 2012, 02:56 PM
How would one go about changing

v_2011-07-21.grib 2

to

v_2011-07-21.grib


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!



chown33
Jun 12, 2012, 03:15 PM
I don't know what NCL is.


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

It will also match other filenames, such as:
Dale.gribble.txt



To change a bunch of filenames, you should first identify what a safe new filename is. Is simply stripping the " 2" safe?

Automator.app 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

sero
Jun 12, 2012, 03:34 PM
How would one go about changing

v_2011-07-21.grib 2

to

v_2011-07-21.grib


sed s/\ 2$//g