#1 2023-09-19 15:10

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

Rearrange rule to change the case of only one part of a file name?

I have multiple files that have the same file name pattern: The name of the author appears at the end.
I want to capitalize the first letter of each word in this part.

Stefan had posted a PascalScript solution to convert the case of parts of file names.

But newbies would be scared of using such solutions.

It would be great if we can use the Rearrange rule for this purpose, by adding switches that change the case of the tokens ($1, $2, etc).

For example, $1 - \C$2 should change the $2 text to ALLCAPS.
(\C being the switch that converts the subsequent token to ALLCAPS)

Other switches could be-

\C capitalizes all text (ALLCAPS)
\c capitalizes the first letter of each word
\L lowercases all text
\S sentence case
\i inverts the case
\F capitalizes the first letter, but preserves the case of the rest of the name.

Essentially, extend the Rearrange rule with the switches used in the RegEx rule...

Last edited by narayan (2023-09-19 15:23)

Offline

#2 2023-09-19 15:33

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

Re: Rearrange rule to change the case of only one part of a file name?

BTW, the RegEx rule does not have an option to capitalize every word.
It should be added.

The \u switch actually converts the text to sentence case, and therefore it should be renamed as "\S"

Offline

Board footer

Powered by FluxBB