Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Renaming files

  • 09-06-2008 12:07PM
    #1
    Registered Users, Registered Users 2 Posts: 224 ✭✭


    I have a folder which contains about 3000 images. They are all named e.g. 12345_01.jpg. I basically need to save them down to 12345.jpg loosing the "_01" bit.
    Any suggestions how i could go about this


Comments

  • Closed Accounts Posts: 8 allexxei


    What OS do you have there ?


  • Registered Users, Registered Users 2 Posts: 224 ✭✭The Mighty Dubs


    Win XP Pro


  • Closed Accounts Posts: 8 allexxei


    I don't think there is something allready done in the OS to help you to rename all files, so you should write a vbs file to do that


  • Registered Users, Registered Users 2 Posts: 2,157 ✭✭✭dazberry


    rename ?????_??.jpg ?????.jpg

    D.


  • Closed Accounts Posts: 8 allexxei


    I know ! , but you can't do it bulk with rename :) Wasn't this your problem ?

    That's why I said you should have a script to run this rename command


  • Advertisement
  • Closed Accounts Posts: 8 allexxei


    Try this

    rename *_01.jpg *.jpg


  • Registered Users, Registered Users 2, Paid Member Posts: 2,032 ✭✭✭lynchie


    I have a folder which contains about 3000 images. They are all named e.g. 12345_01.jpg. I basically need to save them down to 12345.jpg loosing the "_01" bit.
    Any suggestions how i could go about this

    Plenty of free bulk file renamers around. Do a quick google.


  • Registered Users, Registered Users 2 Posts: 1,267 ✭✭✭00sully


    I wrote a nice app that does this with some nice options. drop me a pm and ill send it on to ya :)


  • Registered Users, Registered Users 2 Posts: 1,346 ✭✭✭carveone


    I have a folder which contains about 3000 images. They are all named e.g. 12345_01.jpg. I basically need to save them down to 12345.jpg loosing the "_01" bit.
    Any suggestions how i could go about this

    As dazberry sez, question marks will work if they are fixed width.

    Eg: rename ?_foo.jpg ?.jpg works for me.

    Else you can do it with a bit of messing:
    dir /b *_*.jpg > 1
    for /F "delims=_ tokens=1*" %i in (1) do rename "%i_%j" "%i.jpg"
    

    The dir makes a file called "1" with a list of names. The for options makes an entry like: 12345_01.jpg into two parameters. %i is "12345" and "%j" is the rest of the line. Thus for that file the command would be:

    rename "12345_01.jpg" "12345.jpg"

    The quotes are there in case the filename has spaces. Hope this helps.


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    00sully wrote: »
    I wrote a nice app that does this with some nice options. drop me a pm and ill send it on to ya :)

    What part of don't ask for private messages in thread don't you understand?


  • Advertisement
Advertisement