Question

  • Creator
    Topic
  • #2146464

    Changing multiple file extensions in VB

    Locked

    by jiminpa ·

    Hello all
    I need some help automating the renaming of a large group of files. I have an application that stores a large number of files in a folder. Occasionally one of these files gets corrupt and must be deleted. The files are sequential by the file extension. So I may have something that looks like this. All in the same folder.

    XY123456.f01
    XY123456.f02
    XY123456.f03
    XY123456.f04
    XY123456.f05
    XY234567.f01
    XY234567.f02
    XY234567.f03

    Usually the file ext’s go as high as .f55. You’ll notice the different file names XY123456 and XY234567 belong to different groups and while stored the same place do not belong to the same part of the application.

    Here’s what I want to do let say in the group XY123456 the file with ext .f02 gets corrupt. I need to rename .f03 -> f02 and then continue to subtract 1 from the number in the file ext until I get to the last file in that group. What I do not want to have accidentally happen is every single file in the folder have 1 subtracted from it. Only the files in the group I specify. I hope that makes sense. Can anyone help me with this?

All Answers

Viewing 0 reply threads