#1 : 31/01-25 00:05 Chris O
Posts: 1
|
I'm not sure if this is the place for requests.
Regarding the batch method "New Case", an option for 'Title Case' would be welcome as this excludes the capitalization of minor words (mostly prepositions and conjunctions) such as "and, the, of, with" etc. This case is most popular with movie titles and some news headlines. E.g: "Harry Potter and the Philosopher's Stone" However if the minor word is at the start, it is kept as a capital. "The Matrix" This Wiki page describes all of the case types in better detail: https://en.wikipedia.org/wiki/Letter_case |
#2 : 31/01-25 04:40 Delta Foxtrot
Posts: 423
|
Reply to #1:
Hi Chris, welcome, This is probably as good a place as any for suggestions; at any rate, you are not the first by any means. :) Over the years I've made several different ways of doing what you are asking. The method I'm going to suggest to you looks somewhat complicated (if you are not proficient in regular expressions, at any rate), but it's really a pretty simple way to do what you are asking in something like the minimum steps. And setting this up will be way faster than waiting for the change to be incorporated into the program itself, if it even is. The design is this: First use a "New case" method to capitalize all words, then use a "List replace" method to make internal minor words lowercase again. Here's the deal. 1. New Case method. New case: Upper case Location: First letter in every word Apply to: Name 2. List Replace method: (Note: There are spaces in all entries, so be sure to enter or copy them if you decide to use this batch. Each entry except the last has a leading space on both parts; the last entry has a trailing space on each part. (EDIT: I forgot this forum program doesn't really deal with tabs, so I'm going to put the Replace/Replace With pairs on two lines followed by a blank line. That'll be easier to copy anyway. EDIT 2: Turns out the software cuts off a leading space as well, so just know you need a space before each entry in the List replace method except the last one. Sorry. You'll see it in the example screenshot below.) The([ ,]) the$1 A([ ,]) a$1 A(n|nd)([ ,]) a$1$2 With([ ,]) with$1 In([ ,]) in$1 Of([ ,]) of$1 But([ ,]) but$1 (\w)'(\w) $1'\l\2 Case sensitive CHECKED Use regular expressions CHECKED Apply to: Name That's it. The "Replace" entries just check that there's a space before the words we want lowercased and that there's either a space or a comma after (since we don't want to lowercase, for instance, "Within" or "Andover" or "Official"). You can always add more cases just by following the naming scheme: a space to start, the capitalized word you want to lowercase, and "([ ,])" in the Replace field, and a space, the lowercase word, and "$1" in the Replace with field. (EDIT: for instance, I assume you'll want to add "For" to the words to be lowercased; that would be Replace: <space>For([ ,]) Replace with: <space>for$1 END EDIT The last replace is different. It's there to fix what appears to be a bug in the "New Case" method wherein if a word ends with an apostrophe and a letter, i.e. a possessive, the program treats the letter after the apostrophe as a new word and capitalizes it. This last entry just looks for a letter followed by an apostrophe, then another letter, then a space, and lowercases that last letter (leaving everything else the same). There may be a few cases where this won't work completely correctly, but they should be fairly scarce (unless of course you have a book title buried inside other text in the filename, in which case you get what you get–but an addition to the new case method wouldn't work in that situation either, so I'm assuming that's not a problem). BTW, you can always add more "Replace" methods after these two methods to fix any minor problems you encounter. Here's a screenshot of the results, using the text in your message as a series of filenames. https://drive.google.com/file/d/1HYUmP3t_1b7wKNK vIuF5mbOWTLxC1siC/view?usp=sharing Good luck, let us know if you need more help! Best, DF |
#3 : 31/01-25 07:28 Kim Jensen
Administrator
Posts: 958 |
Reply to #1:
One issue with title case is that it is probably only used in English. Making it work in every language can be challenging. In my native language, it doesn't make sense to lower case these smaller words, since some of them are nouns, for example "and" means "duck" and "the" means "tea". Another issue is that title case is very poorly defined. You can quickly see that on Wikipedia itself. If you look at this page https://en.wikipedia.org/wiki/Capitalization#Tit le_case you will see the example: The Quick Brown Fox Jumps Over the Lazy Dog But if you look at the main article https://en.wikipedia.org/wiki/Title_case you will see a difference in the word "Over": The Quick Brown Fox Jumps over the Lazy Dog Which one is correct? Well there are no defined rules. It is just a matter of taste and personal style I guess. For movie titles, I see often that only the most basic words are lowercased (and, the, of, in). You can use the replace lidt method and add each of these. Just remember to surround the words with spaces so that they will not be applied to parts of a word and the first and last word of a sentence. |