Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

File Renaming


semlemsushi
 Share

Recommended Posts

I'm looking for a program that will rename my sprites. The images in the folder are 1-600\. All I need to do to the names are add +72 to them. So basically, 1 would change to 73, 2 would change to 74, 3 would change to 75, and so on. Is there a program that can do this? Or a tutorial perhaps? Thanks guys!
Link to comment
Share on other sites

Something like this would work.

```
    Dim file As String
    Dim newfile As String
    Dim i, j As Long

    For i = 1 To 600
        file = "insert filepath here" & i & ".bmp/.png"
        Picture1.Picture = LoadPicture(file)
        j = i + 72
        newfile = "insert filepath here" & j & ".bmp/.png"
        SavePicture Picture1, newfile
        Picture1.Picture = Nothing
        Kill file

    Next
```
Link to comment
Share on other sites

I meant from memory as in I didn't know of a way to do it like that. But after some just looking it up on google I came up with this:

```
Dim file, newfile As String
Dim i As Long

For i = 1 To 600
    file = "filename" & i & ".bmp"
    newfile = "filename" & (i + 72) & ".bmp"
    Name file As newfile
Next

```
Better?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...