Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Renaming Images...

Status
Not open for further replies.

sladewilson

Programmer
Feb 14, 2002
90
US
I have a directory full of images (about 2000 of them). The images all have numeric names that match item numbers in a database... example Item #1378 might be a Blue Shoe and the picture for that shoe is named 1378.jpg

I have to use a new database application that is gonna start with item #1 instead of the item schema we used with the older system. Is there some way I can use a Excel Spreadsheet with the mappings from the old item number to the new item number and have Photoshop run some sort of batch on this to convert the images to the new item number??? Example:

Old Item Number New Item Number
1293 1
1739 2
1931 3

etc...

If someone can think of another way to skin this cat PLEASE SELL ME A CLUE!
 
I have a folder containing files with names of the format:
companynamePmmw.nec where mmw equals month and week number

I needed to change the file name to:
mmwPcompanyname.nec

I used the following excel macro that you should be able to alter to do your renameing.

I hope I understand your need, if not let me know.

Code:
Sub RenameFiles()
'Rename EDI files from companynamePmmw.nec to
'                      mmwPcompantname.nec
Dim OldFileName As String, NewFileName As String, FolderName As String
Dim TempDate As String
    FolderName = "V:\Rename files\"
    OldFileName = Dir(FolderName & "*.nec", vbDirectory)

    Do While OldFileName <> ""
        'Check last 3 chars of name are numeric
        TempDate = Mid(OldFileName, Len(OldFileName) - 6, 3)
        If IsNumeric(TempDate) Then
            NewFileName = TempDate & Left(OldFileName, Len(OldFileName) - 7) & ".nec"
            Name FolderName & OldFileName As FolderName & NewFileName
        End If
        OldFileName = Dir
    Loop
End Sub

sam
 
If you are using Windows, Windows Explorer can rename the images and assign a sequence number. The downside is that the sequence number will be in parentheses.

Simply select all the images. Then rename the first one. Lets say 'New Name(1)'. Explorer will then rename them all as New Name(2), New Name(3), etc.
 
Kiddpete,

Thanks for the suggestion. But I need a way to rename the pictures using a data MAP ie. from a data source. See my example in the original post.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top