Replace Column A values with Column B values.

Javascript renaming examples. Javascript renaming is supported in version 3 or newer.

Replace Column A values with Column B values.

Postby tyrion88 » Fri Feb 24, 2017 3:15 pm

Hi there!

I am extremely new to this. And I have figured out on BRU how to use the basic replace function. Which is fine, but I have a whole series of variables to replace for literally thousands of files. Is there a way I can do this through Javascript Renaming? Or some other way?

Ie:

Original File names:

1_a.jpg
1_b.jpg
2_a.jpg
2_b.jpg
3_a.jpg
...and so on.

What I want in the end:

JohnDoe_a.jpg
JohnDoe_b.jpg
JaneDoe_a.jpg
JaneDoe_b.jpg
JimmyDoe_a.jpg
....and so on.


Basically I have an excel sheet with the original value on the left (1,2,3,etc), and the replacement value on the right (JohnDoe, JaneDoe, JimmyDoe, etc).

Is there anyway to make this happen (with or without the excel sheet)?


Thanks in advance for any help!!!
tyrion88
 
Posts: 2
Joined: Fri Feb 24, 2017 3:06 pm

Re: Replace Column A values with Column B values.

Postby KenP » Wed Mar 29, 2017 2:05 pm

You may have done the job by now, but if not this should work.

1.
Back up your files before renaming them

2.
In Excel:
Column A should contain the original file names.
Column B should be a bar |
Column C should contain the new file names.

3.
Select the whole range.

4.
Save the range as a .txt file (File / Save As / Browse / Save as type = Text(MS-DOS).txt : Name = Rename.txt)

You should now have a text file where the contents look like this:
Old_file_name | New_file_name
Old_file_name | New_file_name
Old_file_name | New_file_name
Include the file extension in the file names i.e. Old_file_name.jpg | New_file_name.jpg
(It doesn't seem to matter if there's a single space or a tab space between the columns)

5.
From the BRU menu bar select Actions / Import Rename-Pairs

6.
Select all the files and check the new file names in the "New Name" column.

7.
Rename.
KenP
 
Posts: 193
Joined: Sat Jul 30, 2016 11:25 am


Return to Javascript Renaming


cron