Can Notepad++ check for uppercase letters?
-
Let’s say that I have a document in Notepad++ where all the words are written in lowercase format.
For instance, “Ukraine” is written “ukraine”, “John” is written “john”, and so on and so forth.
That’s the way a YouTube automatically generated transcript looks like, for example.
Now, is there a way to command Notepad++ to put an uppercase letter where usually one is warranted?
I know that it probably wouldn’t be a perfectly done job most of the cases, but it should be a no brainer for a computer that “john” and “ukraine” are probably going to be written with an uppercase letter.
Thank you!
-
@fairbanksbiz said in Can Notepad++ check for uppercase letters?:
but it should be a no brainer for a computer that “john” and “ukraine” are probably going to be written with an uppercase letter.
This is (in general) faulty thinking.
Short answer: No way to do what you are seeking with Notepad++.
-
The best you’ll do is this to capitalize every letter at the start of a word. Since ‘proper’ capitalization is subject to context, a simple mass search/replace process involved in regex can’t be expected to do this. Maybe a word processor will do a better job, since it can have a grammar checker, spell checker etc as part of it’s arsenal. The following will capitalize every first word character:
Find:
(\b[a-z](?!\b))
Replace:\U$1
Regular expression
. Matches newline unchecked -
@lycan-thrope said in Can Notepad++ check for uppercase letters?:
The best you’ll do is this to capitalize every letter at the start of a word
Yes but I don’t think OP would want to translate this text:
Maybe a word processor will do a better job, since it can have a grammar checker, spell checker etc as part of it’s arsenal. The following will capitalize every first word character
into:
Maybe a Word Processor Will Do a Better Job, Since It Can Have a Grammar Checker, Spell Checker Etc As Part Of It’s Arsenal. The Following Will Capitalize Every First Word Character
-
I’ve already acknowledged it won’t do what he wants and it was quick and dirty so I’d have to tune it for single letter words, but other than that and maybe some other issues, it’s close enough to what it could have done. I at least confirmed your point. Going through and capitlizing only single ‘a’ should be a cakewalk. :)
-
@fairbanksbiz said in Can Notepad++ check for uppercase letters?:
That’s the way a YouTube automatically generated transcript looks like, for example.
… but it should be a no brainer for a computerWhy do you think it would be a no-brainer for a computer , when the YouTube auto-generated transcripts, which come from computers with millions (billions, maybe, given how long YouTube has been around) of dollars of R&D behind them got them wrong? Why you then think it would be easy for the free-to-you open-source small-team/no-budget Notepad++ application to know a list of every proper name in English, and to then be able to know to capitalize them? This is a mystery to me.
If you have a list of words that you know are proper nouns that need to be changed in your particular document, you could set a regex to FIND =
(ukraine|john|peter|fairbanksbiz)
and REPLACE to\u$1
(where, per documentation,\u
means “capitalize the next letter” and$1
means “use the stuff matched in parentheses-group-number-1 from the FIND text”). You can make that example list up to a few thousand characters long by just appending more|
between more words. But even that example won’t work if your text has Johnny-boy using the john, or if Peter’s long paragraph was petering out.(In case reminding you that You Tube’s complexity was not sufficient to get the right case on those words was not enough to help you understand, those examples were to show you that the job that you thought was a no brainer is not a simple action, and to get a computer to understand that task – without feeding it a pre-programmed list of words with algorithms to determine when exceptions need to be made – has been a major goal of artificial intelligence research for my entire lifetime. The Notepad++ developer, as good as he is, is not on the forefront of AI in his coding of Notepad++.)
-
@peterjones I didn’t mean to say it should be a no-brainer for a computer to do the job that I thought would be a no brainer with also getting all the exceptions that need to be made right. In fact, notice that I said “it probsbly won’t be a perfectly done job”.
At any rate, I gather it’s not the right task to perform with Notepad++ and a word processor is probably what is best suited for me here.
Thank you.