Would like Sentence Case only after a certain point.

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

Would like Sentence Case only after a certain point.

Postby vdofan » Sun Oct 25, 2015 10:26 pm

Is there a way to set BRU so that only after a specified point in a file name will Sentence Case be put into effect?

So for instance, my files all have this string within them spacedashspace " - " (without the quotes) to separate the author and the title like such "author - title".

I would like just for everything after the spacedashspace " - " to be sentence case. So that the author's names won't be effected in any way.

Thank you to anyone who is able to help me achieve this.
vdofan
 
Posts: 1
Joined: Sun Oct 25, 2015 10:14 pm

Case change on part of file name only (PowerShell)

Postby Stefan » Mon Oct 26, 2015 3:00 pm

Hi vdofan,

it is always a good practice to provide a few Before/After Examples of file names you have/wont.

- - -

Would like Sentence Case only after a certain point.
New postby vdofan » 25 Oct 2015, 23:26
I would like just for everything after the spacedashspace " - " to be sentence case.
So that the author's names won't be effected in any way.

For example:

FROM:
Arthur, Dent R.R. - Don't panic.PDF
John S. C. Abbott - The Iron Dragon's Daughter.PDF
Marvel, J.R.R. - Pumuckl aus Lönneberga.PDF
Thomas B. Allen - When the King Comes Home.PDF


TO:
Arthur, Dent R.R. - Don't panic.pdf
John S. C. Abbott - The iron dragon's daughter.pdf
Marvel, J.R.R. - Pumuckl aus lönneberga.pdf
Thomas B. Allen - When the king comes home.pdf

- - -


Answer:

Partly case change is not supported by BRU.

But you can use a scripting language to perform the manipulation
and then utilize BRUs' "Renaming From A Text File" feature.
(http://www.bulkrenameutility.co.uk/forum/viewtopic.php?f=4&t=2555)




For example you can use PowerShell to create such a list (join that next two line first):

$A="";$L="";Dir * - * |%{$A=$_.Name -split(" - ");$L+=$_.Name+"|
"+($a[0]+" - "+$a[1].substring(0,1).toupper()+$a[1].substring(1).tolower())+"`r`n"};$L > _Rename-pairs.txt




Execute that line in a PowerShell console, after you have changed the current working directory to the folder of your files.
(Best work on copies of your real files)


_Rename-pairs.txt will contain now:

Arthur, Dent R.R. - Don't Panic.pdf|Arthur, Dent R.R. - Don't panic.pdf
John S. C. Abbott - The Iron Dragon's Daughter.pdf|John S. C. Abbott - The iron dragon's daughter.pdf
Marvel, J.R.R. - Pumuckl Aus Lönneberga.pdf|Marvel, J.R.R. - Pumuckl aus lönneberga.pdf
Thomas B. Allen - When The King Comes Home.pdf|Thomas B. Allen - When the king comes home.pdf



In BRU use the "Renaming From A Text File" feature (File > Import Rename-pairs) to import that list.

If everything looks fine, go ahaed and [Rename]



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

Re: Would like Sentence Case only after a certain point.

Postby Admin » Mon Jan 11, 2016 11:21 am

PS partly case change is now supported in version 3 using Javascript renaming.
Admin
Site Admin
 
Posts: 2351
Joined: Tue Mar 08, 2005 8:39 pm


Return to BRU Support