locked
Batch rename files RRS feed

  • General discussion

  • I wondered if someone could help me with the below...

    I have around 25k video files in around 600 folders that I would like to batch rename.

    The file names look like this:

    file_20150101_dubai_2_27535.mp4
    file_20150308_london_13_4_1_26893.mp4
    file_20150103_london_12_1_24466.mp4
    file_20150213_new_york_2_1296.mp4
    file_20150709_abu_dhabi_7_3849.mp4
    file_20150424_doha_1_12_10921.mp4
    file_20151102_berlin_6_3_417.mp4

    To simplify the file names I would like to keep just the video number (with the underscore) which is the string of digits just before the extension (_27535, _26893, _24466, etc...) and everything in front of the underscore replace with "video" word.

    The final out put would look like this:

    video_27535.mp4
    video_26893.mp4
    video_24466.mp4
    video_1296.mp4
    video_3849.mp4
    video_10921.mp4
    video_417.mp4

    Regards

    Max

    • Changed type Bill_Stewart Thursday, February 11, 2016 10:22 PM
    • Moved by Bill_Stewart Thursday, February 11, 2016 10:22 PM This is not "scripts on demand"
    Monday, January 11, 2016 4:58 PM

All replies

  • If by "help you" you mean "write a script for you," the answer is unfortunately no. That's not the purpose of this forum.

    We would recommend that you can use PowerShell, however. There are also tools you can download that are designed for bulk renaming of files if you don't want to learn how to script it.


    -- Bill Stewart [Bill_Stewart]

    Monday, January 11, 2016 5:10 PM
  • Rename-Item $file -NewName ($file.Fullname -replace 'file_','video_')

    \_(ツ)_/

    Monday, January 11, 2016 5:35 PM
  • Rename-Item $file -NewName ($file.Fullname -replace 'file_','video_')

    A quick solution that will not do what the OP wants to do.
    Monday, January 11, 2016 5:52 PM
  • Rename-Item $file -NewName ($file.Fullname -replace 'file_','video_')



    A quick solution that will not do what the OP wants to do.

    A template - not  solution.


    \_(ツ)_/

    Monday, January 11, 2016 6:18 PM