Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Adding number prefix based on text in file name  (Read 1796 times)

0 Members and 1 Guest are viewing this topic.

razortooth

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Mac OS
    Adding number prefix based on text in file name
    « on: August 07, 2017, 12:25:02 PM »
    Hi, Noob here.
    I'm trying to learn some basic unix to make some mundane tasks easier. In my job I often get surround sound audio files provided and manually add numbers to retain the order for injest into other programs. I have seen some commands for renaming or replacing text in strings, however I don't think this will help.
     
    audio.L.wav
    audio.R.wav
    audio.C.wav
    audio.Lfe.wav

    Would need to become

    1_audio.L.wav
    2_audio.R.wav
    3_audio.C.wav
    4_audio.Lfe.wav

    Does anyone have an idea of the best way to have a script recognize the .L.wav in the file name and just add a 1_ to the beginning?

    Many thanks in advance.