#1 2018-09-27 08:58

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Capitalize the character that follows the specified characters

For my work, I often have to download a large number of research papers, which are in the form of pdf files.

Most of these files have titles and subtitles, separated by a character, such as comma, and semicolon.
Personally I like to use " - " (space, hyphen, space) as separator.

After renaming the files, I like to change the case of the title and the subtitle to sentence case.
(only first letter capitalized, the rest lowercase).

This increases the readability.

Here is a sample:

The impact of organizational behavior on employees behavior - Pharmaceutical companies in Maharashtra

To achieve this, I need an additional option in the Case rule:
Capitalize the first character that follows the specified characters (ignore spaces).

So if I specify a hyphen (-) as my character, then I can achieve this.

Note that this feature can be useful to many researchers and college students who have to maintain a bibliographical collection.

In general, we also need to capitalize the letter that follows " or (.

This is why this command should allow the user to specify multiple characters.
In this example, I can enter "(- in the command, and achieve all capitalization in one shot.

Can this be done?

Offline

#2 2018-09-27 22:24

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: Capitalize the character that follows the specified characters

It can be achieved with the following rule:

Regular Expressions: Replace expression "(\s+\-\s+\w)" with "\U$1" (skip extension)

Thanks to the case manipulation features of the Regular Expressions engine.

It may not be as convenient as a simple checkbox option which you propose, but it does the job.

Is it still worth implementing it as an individual feature?

Offline

#3 2018-09-28 06:08

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Re: Capitalize the character that follows the specified characters

Well, I have created the help on RegEx for ReNamer and xplorer2, and in that process tried all expressions myself.
Yet I don't use RegEx myself.

Therefore I am able to understand both types of users: Those who know RegEx well, and those who don't.

On the whole, it would be best to have this as an "easy to use" option, not as a RegEx trick.
(Note that if I want to specify multiple characters, the RegEx expresion becomes very complex.)


How to implement:
Usually this is needed in addition to the Capitalize only the first character option.
Therefore it can be a sub-option of the Capitalize only the first character option, with a checkbox (not a radio button).

Also, please add "(- as default characters in its input box.
The user can delete whatever he does not want.

Last edited by narayan (2018-09-28 06:12)

Offline

#4 2018-09-30 11:45

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: Capitalize the character that follows the specified characters

This feature was added to the list.

The delimiter may need to contain more than one character, so it is probably best to treat it as a single value instead of a collection of delimiting characters. This implies that you would need to use 2 separate rules for handling both "-" and ")" characters at once.

Logic wise... Should this option affect whatever the first found letter that appears after the delimiter (A), no matter how far out, or it must explicitly follow the specified delimiter (B)? I can't think of an example right now where it would really matter, but, nevertheless, these methods may produce different results.

A benefit of method A is that it will automatically handle multiple spaces and other padding characters following the delimiter.

Offline

#5 2018-10-01 06:09

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Re: Capitalize the character that follows the specified characters

Yes, I realized this after posting my last message. In my own case, I also have plain hyphens in the name, which are to be skipped.
For example, I do not want to capitalize in hyphenated words, such as "step-by-step", "city-wide", "area-wise", "issue-based", etc...

Only the " - " combination should be detected. But I realized that the rule would capitalize all the hyphenated words also, which is undesirable.

As regards option- (A) or (B), since the Rule takes a character string as argument, we need not require the rule to ignore any number of spaces after one character, because the spaces would be part of the string. So I like option (B).

In any case no one likes multiple spaces in a file name, and Renamer already has a rule to fix multiple spaces.

Offline

#6 2018-10-01 09:18

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Re: Capitalize the character that follows the specified characters

On second thoughts, can we use the + button to add more strings?

For example, I enter a character string, and then press the + button to add the second string.
Renamer finds each of those strings, and capitalizes the character that follows immediately. (no space allowed)
The string itself can have spaces anywhere (beginning, middle, end).

Last edited by narayan (2018-10-01 09:21)

Offline

#7 2018-10-08 15:37

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: Capitalize the character that follows the specified characters

On second thoughts, can we use the + button to add more strings?

We could, but it seems not very user friendly. Particularly the use of cryptic looking delimiters and the squashing of several inputs into a single field.

It is best to leave it as a single input value, unless a better interface is implemented for managing a list of entries (not another multiline text area), which is unlikely at this stage.

Offline

#8 2019-03-17 17:49

vertigo
Member
Registered: 2019-03-10
Posts: 7

Re: Capitalize the character that follows the specified characters

I posted about this issue here and made a few suggestions about how to deal with it. Option B here is the same as the third (and, IMO, best) suggestion I made, as it makes it customizable. I do think it should allow more than one string, otherwise there will still be cases where it won't be enough. For users that need a basic use of it and only need one string, there will be no confusion because they'd just type that in and be done. For users that do need more than one string, yes, they'd have to deal with separators, which would add a very small amount of additional complexity, but it would still be far easier than other options (regex or, as I did, making an extensive replace rule), and so would undoubtedly be very welcome. And it could be done just like in the replace rule, where the user could just type one string and then click a button to add a separator, then type the next string. Pretty easy to figure out, and if kept the same it would create continuity throughout the program, making it even easier (except it did take me a bit to get the hang of the *|* because it seemed like the asterisks would act as wildcards, so perhaps a different separator altogether wouldn't be a bad idea, like just ||, which would also be cleaner).

Offline

Board footer

Powered by FluxBB