Rename multiple files with multiple names

November 16, 2012 at 17:47:00
Specs: Windows 7

I have 1000 photos, each one is nammed like: 0_45636.jpg and I need to add a prefix like: 6 _ 10 _ 215 _ 0_45636.jpg , but vor every single file need to add a different prefix from a list.
for example the desired result need to be:

6 _ 10 _ 215 _ 0_45636.jpg
8 _ 21 _ 44 _ 0_2858.jpg
34 _ 36 _ 30 _ 0_4401.jpg
.......

Which is the easiest way to do that?
I have a excel list with 1000 prefixes and another one with actual names of pictures

Maybe I can do that directly from excel or something...


See More: Rename multiple files with multiple names

Report •


#1
November 16, 2012 at 18:36:33

Does it matter which file gets which prefix?

==============================
M2 http://golden-triangle.com


Report •

#2
November 16, 2012 at 19:23:52

Here's a stab at "zipping" (my term for horizontal-append):
::===== begin batchscript
@echo off & setlocal enabledelayedexpansion
::load memory-array vars from file1
for /f "tokens=*" %%a in (test1) do (
set /a i+=1
set x!i!=%%a
)

:: obtain one (incremental) line from file2
for /f "tokens=*" %%a in (test2) do (
set v=%%a
call :test
set /a z+=1
if !z! geq %i% goto :eof
)

:test
:: join each var to matching-seq. line from file2 and output
echo ren !x%z%! %v%!x%z%!
::===== end
remove 'echo' from last line if you're brave enough to try.


Report •

#3
November 17, 2012 at 01:18:36

Does it matter which file gets which prefix?

yes, for each file is a specific prefix


Report •

Related Solutions


Ask Question