Simple filename capitalization

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
bifjamod
Posts: 9
Joined: 01 Oct 2015 03:06

Simple filename capitalization

Post by bifjamod »

How can I convert a file name to all caps? For example, I might accidentally name my file 32760dox, and need it to be 32760DOX (for the sake of consistency). I've tried with a Regex pattern, with no success:

Code: Select all

([*.*]) > \U$1
That just tries to append the letter U to my file name....the file extension does not need to be changed.

TIA

highend
Posts: 14996
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Simple filename capitalization

Post by highend »

The VB regex engine is limited and doesn't support \U.

A script (on a button / keyboard shortcut, etc.) would e.g. do it:

Code: Select all

renameitem(recase(gpc(<curitem>, "base"), "u"), , 1);
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66678
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Simple filename capitalization

Post by admin »

If the extension can be upper case as well then it's built in:

menu File | Rename Special | AAA AA.AAA

bifjamod
Posts: 9
Joined: 01 Oct 2015 03:06

Re: Simple filename capitalization

Post by bifjamod »

admin wrote:If the extension can be upper case as well then it's built in:

menu File | Rename Special | AAA AA.AAA
Thanks admin; I'd prefer not to have capitalized extensions, but it's preferable to uncapitalized file names!

bifjamod
Posts: 9
Joined: 01 Oct 2015 03:06

Re: Simple filename capitalization

Post by bifjamod »

highend wrote:The VB regex engine is limited and doesn't support \U.

A script (on a button / keyboard shortcut, etc.) would e.g. do it:

Code: Select all

renameitem(recase(gpc(<curitem>, "base"), "u"), , 1);
highend - thank you very much! This was exactly what I needed; just wish I hadn't dilly-dallied 5 months before setting it up!

Post Reply