renaming avi files to match srt files...

A swapping-ground for Regular Expression syntax

renaming avi files to match srt files...

Postby sampah » Tue Dec 14, 2010 8:29 pm

hi, im new here, sorry if this not the right section...
here's the thing, i already rename my batch of subtitle files with the episode number, title and all...
how can i rename my video files to match those subtitle files, accordingly using BRU...
thanks...
sampah
 
Posts: 1
Joined: Tue Dec 14, 2010 8:24 pm

Re: renaming avi files to match srt files...

Postby Stefan » Sat Feb 12, 2011 7:51 pm

sampah wrote:hi, im new here, sorry if this not the right section...
here's the thing, i already rename my batch of subtitle files with the episode number, title and all...
how can i rename my video files to match those subtitle files, accordingly using BRU...
thanks...


For the challenge "Rename AVI files (old name) like SRT files (new name)"

Read the help about "Renaming From A Text File"
To use this facility, create a text file in for the correct format, for example:

Track001.mp3|Headlong.mp3
Track002.mp3|Rushes.mp3
TRACK003.mp3|AnywhereIs.mp3

As you see, there is one entry per line.

Next, click the Import option on the File menu and load your file. If the file is valid then you will see the "new name"
column reflecting the contents of the text file.






The idea of this post is to use excel to create such an text file.

Generally spoken:
having the old name in one column (A1), and the new name in an another (B1),
then merging that two columns and add an pipe-symbol "|" as delimiter.
The basic syntax in excel therefor is in column (C1) '= A1 & "|" & B1'
Then use the excel options to copy that formula down all lines.
Code: Select all
         A         B              C                    D          E              F
1     old1      new1        old1|new1
2     old2      new2        old2|new2
3     old3      new3       = A3 & "|" & B3
4     old4      new4     
5     old5      new5     
6     old6      new6     
7
8







Please read an step-by-step explanation for the above challenge, for other issues you may skip some steps.
(EDIT: see the link at the end to see an picture how this looks in excel)


1)
Use
Selection(12) *.avi
to see *.AVI files only


2.)
select All and use context menu > copy to clipboard Name + Ext


3.)
Open Excel and paste this list to column A
Code: Select all
A
AVI name.avi
AVI name.avi
AVI name.avi



4.)
In Excel column B cell 1 write an pipe symbol |
and use Excel to copy it in all cells down the B column
Code: Select all
A               B
AVI name.avi   |
AVI name.avi   |
AVI name.avi   |



5.)
In BRU use
Selection(12) *.srt
to see *.SRT files only

6.)
select All and use context menu > copy to clipboard Name (without Ext)

7.)
paste this list in Excel column C
Code: Select all
A               B   C
AVI name.avi   |   SRTname
AVI name.avi   |   SRTname
AVI name.avi   |   SRTname


8.)
In Excel write .avi into column D and paste it down the column
Code: Select all
A               B   C                       D   
AVI name.avi   |   SRTname     .avi
AVI name.avi   |   SRTname     .avi
AVI name.avi   |   SRTname



9.)
In Excel write this command into column E and paste it down the column
Code: Select all
A               B   C                    D          E
AVI name.avi   |   SRTname     .avi      =A1&B1&C1&D2
AVI name.avi   |   SRTname     .avi      =A2&B2&C2&D2
AVI name.avi   |   SRTname


to get
Code: Select all
A               B   C             D      E
AVI name.avi   |   SRTname    .avi  AVI name.avi|SRTname.avi
AVI name.avi   |   SRTname    .avi  AVI name.avi|SRTname.avi
AVI name.avi   |   SRTname



10.)
select the E column and paste this as text to an text file:
Code: Select all
AVI name.avi|SRTname.avi
AVI name.avi|SRTname.avi
AVI name.avi|SRTname.avi
AVI name.avi|SRTname.avi



11.)
In BRU use the "Renaming From A Text File" feature.

Code: Select all
        1. Select the folder which contains the objects you wish to rename.
        2. Select the files you wish to process (use CTRL or SHIFT to select multiple files).
        3.  Enter the renaming criteria.
             Here, click the Import option on the File menu and load your file.
             If the file is valid then you will see the "new name" column reflecting the contents of the text file.
        4. Hit the Rename button. (This button is not enabled unless you have selected one or more files/folders to rename!)


HTH? :D
Puhh, i hope i didn't mixed something up! avi, srt,,,srt,avi, excel, avi,srt,... ;-)



BTW:
we can also do this with Excel without all this steps between, just enter this as command:
= A1 & "|" & C1 & ".avi"





EDIT:
i have found an web side about Excel to help you using it: http://www.mrexcel.com/articles/function-to-merge-two-columns.php
IF that side is down, please find an picture of it there >>> http://forentmp.lima-city.de/BRU_Excel_Merge2Columns-c16.png

EDIT:
To join just two lists together, e.g. two directory listings,
i have wrote an little JavaScript to do this.
It's written with EmEditor, but can be adopted i think for others too.
http://www.emeditor.com/modules/newbb/viewtopic.php?topic_id=2091&post_id=6771&order=0&viewmode=flat&pid=0&forum=19#forumpost6771

Code: Select all
// Paste/Merge/Join two list together side-by-side.
// (see examples) Writes result to new document.
//
// Works like one feature of PASTE.exe
//  paste is a Unix command line utility which
//  is used to join files horizontally (parallel merging)
//  by outputting lines consisting of the sequentially
//  corresponding lines of each file specified, [...]
//  It is effectively the horizontal equivalent to the
//  utility cat command which operates on the vertical
//  plane of two or more files.



-----------------------------------------------------
EDIT:

Utilize PowerShell:

#//Get the file name:

#browse to folder with files to become renamed, open PoSh console, and execute
Code: Select all
dir | ForEach{if(!$_.PSisContainer){ $_.Name }} >> oldnames.txt


#browse to folder with files with wanted names, open PoSh console, and execute
Code: Select all
dir | ForEach{if(!$_.PSisContainer){ $_.Name }} >> newnames.txt

#or skip this step, if you have these files in a text file already.



#// Create the list for the Bulk Rename Utility "Renaming From A Text File" method:

#be sure to have both list files together in one folder
Code: Select all
$old=(gc oldnames.txt)
$new=(gc newnames.txt)
$iteration= $old.count -1
$List=""
0..$iteration | ForEach{ $List += ($old[$_] + "|" + $new[$_] + "`r`n")}
$List
$List > List.txt


Now use this List.txt for BRUs "Renaming From A Text File" method!



Find me: Rename from a list "Renaming From A Text File" renaming pairs rename textfile textlist excel sheet
Last edited by Stefan on Tue May 19, 2015 12:34 pm, edited 4 times in total.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: renaming avi files to match srt files...

Postby the_observer » Tue Mar 22, 2011 2:37 pm

Hi all.

After much time searching in the web i think i found at last the solution to my problems which seems to be Stefan's answer.

Yet, i have a problem.

In step 11. stefan says:
In BRU use the "Renaming From A Text File" feature.

So , if i got it right i go to File>Import-Rename Pairs and i load the .txt file which i have created before with the previous steps instructions by Stefan.
But when i press to load the .txt nothing happens in the main view ,where files and renames are shown and the RENAME button stays grayed out.
Should i change something in selections (12) of BRU ?

Do you have any suggestion of what i might be doing wrong?

Thank you for your time reading this and excuse my lame English.

Regards,
the_observer.

P.S. BRU is a great app.
the_observer
 
Posts: 2
Joined: Tue Mar 22, 2011 2:30 pm

Re: renaming avi files to match srt files...

Postby Stefan » Tue Mar 22, 2011 7:44 pm

Hi and welcome.

Did you have read the help which comes with BRU?
I can imagine there is the answer for your solution:

Code: Select all
Using the Application
      Renaming Files and Folders
        It is really easy to rename files and folders.

        1. Select the folder which contains the objects you wish to rename.
        2.  Enter the renaming criteria.
             The column beside the filename will show you what the new filename will become. =>>  only after you did step 3 !!!
        3. Select the files you wish to process (use CTRL or SHIFT to select multiple files).
        4. Hit the Rename button. (This button is not enabled unless you have selected one or more files/folders to rename!)


Select the files you wish to process to see an preview in the New Name column and enable the rename button.

If this was not the problem please ask again.

HTH? :D
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: renaming avi files to match srt files...

Postby the_observer » Wed Mar 23, 2011 9:04 am

Hi again Stefan.

You are right. I didn't read the manual :( although usually i am not lazy and i do.

So, forgive my hasty question and allow me to thank you for your fast and correct answer.

Thank you much.

Regards,
the_observer.

P.S. The heavy Gui of BRU is disheartening but if you master it you have more options to do things than any other renaming utility i have used.
the_observer
 
Posts: 2
Joined: Tue Mar 22, 2011 2:30 pm


Return to Regular Expressions