how to rename the images with names in my excelsheet?

Post any Bulk Rename Command support requirements here. Open to all registered users.

how to rename the images with names in my excelsheet?

Postby harsha » Sat Nov 23, 2013 7:31 pm

I have a product images in bulk and i need to rename those pictures with product names, how can i do that please reply me as early as possible

my sheet is like this
image no name
0001 brush
0002 cleaning oil
0003 television
harsha
 
Posts: 1
Joined: Sat Nov 23, 2013 7:22 pm

BRU/BRC dont support .csv/.xls/etc, Must convert

Postby truth » Tue Nov 26, 2013 5:37 am

BRC doesnt support renaming from a file, you can either:
Use BRU, after converting the excel-data into a RenamePairs-file OR
Use BRC, after converting the excel-data into a batch.

In either case, you still need to know .extensions, Dirs, etc.
truth
 
Posts: 221
Joined: Tue Jun 25, 2013 3:39 am
Location: Earth, OrionArm, MilkyWay

Re: how to rename the images with names in my excelsheet?

Postby dustinsaunders » Thu Feb 20, 2014 1:04 am

You could rename off a CSV file with a regular .vbs file. Something like this, I use it to rename folders off a CSV and could be modified to do what you need:

Code: Select all
'DIM ObjFSO, objCSV

Const ForReading = 1
Const ForAppending = 8

set objFSO = CreateObject("Scripting.FileSystemObject")
set objCSV = ObjFSO.OpenTextFile("listname.csv", ForReading , true )
set objLOG = ObjFSO.OpenTextFile("error.txt", ForAppending, true )

Do until objCSV.AtEndOfStream
   strLine = ObjCSV.Readline
   StrOldFolder = "C:\pathtofile\" & Left(strLine, Instr(strLine, ",") -1 )
   SrtNewFolder = mid(strLine, Instr(strLine, ",") + 1)
   'Wscript.echo "source" & StrOldFolder
   'Wscript.echo "destin" & SrtNewFolder
   If objFSO.FolderExists (StrOldFolder) then
        ObjFSO.MoveFolder StrOldFolder , SrtNewFolder
   else
        Objlog.WriteLine (StrOldFolder)
   end if
   
Loop
ObjCSV.Close
dustinsaunders
 
Posts: 3
Joined: Thu Feb 20, 2014 12:41 am

Rename from .csv

Postby truth » Sun Mar 09, 2014 7:23 am

Another solution:
FOR /f "delims=, tokens=1,2" %F in (renames.txt) do @REN "%F".* "%G".*

It assumes ALL of the following:
Renames.txt is in .csv format & no commas exist within filenames
All files are in the same directory, & all filetypes should be renamed
Renames.txt specifies EntireFilenames (minus .ext)

If anything isnt true, modify as needed or post back with details.
The BRC equivalent is below, in case you need to incorporate more options:
FOR /f "delims=, tokens=1,2" %F in (renames.txt) do @brc32 /pattern:"%F".* /fixedname:"%G" /execute
truth
 
Posts: 221
Joined: Tue Jun 25, 2013 3:39 am
Location: Earth, OrionArm, MilkyWay


Return to BRC Support