FloridaMason

Q: Mass File Rename

Good day,

 

First time posting and more importantly, first time Mac user.  I ran Fedora for 3 years and the last 4 years ran Ubuntu.  In the *nix OS's, the files do not require an extention since the OS looks at the header of the file and makes the determination on the application it will use.  Obviously, this is NOT the case with Mac OS or in Windows. 

 

I work as a network engineer and work primarily on Cisco equipment (routers, switches, firewalls, etc).  I save the running congiguration of all the equipment I work on and some times walk away with 30-40 version of the config for just 3 devices.  When I moved to the Mac however, the Mac OS is identifing the file as a 'Unix Executable File' Kind of file and wanted to 'Open with:' 'Terminal'.  I COULD right-click and choose open with and scrolldown and look for ''TextWrangler' and open it that way, but it would be incredibly inefficient.  I downloaded an 'NameChanger' which kimd of does mass renaming but have not been able to get it to go recursively through a folder structure.

 

I found a doc online that taled about 'Automator'.  I think this is something I could use as a work around.  This is the function I am looking for:

 

1. Open a folder for a customer that contains old config files with no extentions (e.g. Customer A/2013/VPN Configuration)

2. Shift -> Select all the 'ascii' files and right click.

3. Have the contextual menu apprear with 'Services' and choose the Automator script I created.

 

automatorScreenShot.png

 

I appreciate the help in advanced.

 

Thank you.

 

Manny

OS X Mountain Lion (10.8.5)

Posted on Sep 29, 2013 6:47 AM

Close

Q: Mass File Rename

  • All replies
  • Helpful answers

  • by FloridaMason,Solvedanswer

    FloridaMason FloridaMason Sep 29, 2013 1:53 PM in response to FloridaMason
    Level 1 (0 points)
    Sep 29, 2013 1:53 PM in response to FloridaMason

    Was able to figure it out. 

     

    Thankfully it was not too bad.  Although I wish it would auto read the header, I guess this is OK. 

     

    2013-09-29_13-38-20.png

     

    Ended up removing the 'Copy Finder Items' and changed the 'after name' to 'as extension'.  That did the trick.

     

    Manny

  • by John Lockwood,

    John Lockwood John Lockwood Oct 1, 2013 1:35 AM in response to FloridaMason
    Level 6 (9,349 points)
    Servers Enterprise
    Oct 1, 2013 1:35 AM in response to FloridaMason

    As you appear to have significant Linux experience, why not do this in a Shell Script?

     

    That's how I even as a dedicated Mac user do this. You can find a program called Terminal in the Utilities folder which gives you a standard terminal/command line interface.

     

    See /Applications/Utilities