#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2011
    Posts
    1
    Rep Power
    0

    How to rename and add incrementing number suffix on multiple files in Batch Script?


    Hi Everyone,

    I have 500 files coming in and I need to first check if any file(s) exist then rename all of them regardless of what their filename is (the files are named in a different language).

    No need to process them in any order.

    Rename:

    1. Xdf-20110703-+dH--=.xls
    2. Xdf-20110707-+-+8.xls
    3. Xdf-20110707-+j.xls
    4. Xdf-20110708-+Mn.xls
    5. Xdf-20110713-dOnhP.xls
    .
    .
    .
    500


    To:

    TWN_CH_INV_VISIT_FORM_01.xls
    TWN_CH_INV_VISIT_FORM_02.xls
    TWN_CH_INV_VISIT_FORM_03.xls
    TWN_CH_INV_VISIT_FORM_04.xls
    TWN_CH_INV_VISIT_FORM_05.xls
    .
    .
    .
    TWN_CH_INV_VISIT_FORM_500.xls


    Hope you could help me on this one. Ive been trying to do this for weeks.


    Thanks!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    929
    What OS, what language, what have you tried so far?

    You probably won't find anyone here who will write it for you. However, if you show what you have so far and ask a question you'll usually get help.

    (Incidentally, if you're not invested in any language yet, this is the type of problem perl was created to solve. And there's a dedicated perl forum here)
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);

IMN logo majestic logo threadwatch logo seochat tools logo