1. Welcome to Mu-43.com—a friendly Micro 4/3 camera & photography discussion forum!

    If you are thinking of buying a camera or need help with your photos, you will find our forum members full of advice! Click here to join for free!

Need help: Unix script for renaming files

Discussion in 'Image Processing' started by sprinke, May 10, 2011.

  1. sprinke

    sprinke Mu-43 All-Pro

    Apr 5, 2011
    Pasadena, CA
    Debi
    I'll bet there is someone on this forum who can help me out with this.

    I want a simple Unix shell script that will take the MTS files (AVCHD) generated by my GH2 and rename them in the following format:

    YYYYMMDD_originalfilename.MTS

    where YYYYMMDD is the creation date of the file. Or the modification date, which should be the same thing if it's coming directly off the camera.

    I should add that I actually use a Mac. I've tried setting something up with Automator scripts but it fails with an odd error claiming that it can't convert the modification date into a reference.

    Given enough time, I probably would (like the monkeys with typewriters) be able to kluge something workable, but I thought maybe there are some Unix/Linux gurus lurking around here.

    Thanks!
     
  2. travisennis

    travisennis Mu-43 Regular

    63
    Dec 27, 2010
    Indiana
    I am away from my computer right now but I have a python script that should do the trick. I can send it to you when I get back to my machine.
     
  3. mauve

    mauve Mu-43 All-Pro

    Mar 9, 2010
    Paris, France
  4. sprinke

    sprinke Mu-43 All-Pro

    Apr 5, 2011
    Pasadena, CA
    Debi
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.