Prefix file names?

Posted:
in Genius Bar edited January 2014
Hi guys and gals



I have loads of photo files I need to prefix, ie pic_001.jpg needs to be D1_pic_oo1.jpg.



Is there an easy way to do this under mac X or via the CLI?





Cheers



J-E-O

Comments

  • Reply 1 of 3
    stroszekstroszek Posts: 801member
    A Better Finder Rename



    It's the most useful shareware I've ever bought.
  • Reply 2 of 3
    karl kuehnkarl kuehn Posts: 756member
    Here is one command line route:



    Code:




    ls *.jpg | awk '{print ("mv \\"" $1 "\\" \\"D1" $1"\\"")}'









    Play arround with that some untill it looks exactly like you want it to (basically this creates a whole lot of mv comands), and then append:



    Code:




    | /bin/sh





    to it.



    This is all off of ideas first taken from MacOSXHints.
  • Reply 3 of 3
    Done it! - thanks karl it all worked fine.



    I have also found that if you install the scripts menu you can do the same form there.





    Cheers

    J-E-O
Sign In or Register to comment.