• Login
Community
  • Login

Can Notepad++ check for uppercase letters?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
7 Posts 4 Posters 2.3k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F
    FairbanksBiz
    last edited by Mar 27, 2022, 1:43 PM

    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!

    A L P 3 Replies Last reply Mar 27, 2022, 2:30 PM Reply Quote 0
    • A
      Alan Kilborn @FairbanksBiz
      last edited by Mar 27, 2022, 2:30 PM

      @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++.

      1 Reply Last reply Reply Quote 2
      • L
        Lycan Thrope @FairbanksBiz
        last edited by Mar 27, 2022, 8:34 PM

        @fairbanksbiz ,

        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

        A 1 Reply Last reply Mar 27, 2022, 8:40 PM Reply Quote 0
        • A
          Alan Kilborn @Lycan Thrope
          last edited by Mar 27, 2022, 8:40 PM

          @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
          
          L 1 Reply Last reply Mar 27, 2022, 8:47 PM Reply Quote 1
          • L
            Lycan Thrope @Alan Kilborn
            last edited by Mar 27, 2022, 8:47 PM

            @alan-kilborn ,

            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. :)

            1 Reply Last reply Reply Quote 1
            • P
              PeterJones @FairbanksBiz
              last edited by PeterJones Mar 28, 2022, 12:03 AM Mar 27, 2022, 9:22 PM

              @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 computer

              Why 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++.)

              F 1 Reply Last reply Mar 28, 2022, 1:51 AM Reply Quote 3
              • F
                FairbanksBiz @PeterJones
                last edited by Mar 28, 2022, 1:51 AM

                @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.

                1 Reply Last reply Reply Quote 1
                1 out of 7
                • First post
                  1/7
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors