• Login
Community
  • Login

Auto-capital sentences in .txt

Scheduled Pinned Locked Moved General Discussion
2 Posts 2 Posters 175 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.
  • C
    carsten88
    last edited by Sep 22, 2024, 10:50 AM

    How to make each sentence start with a capital letter as I type? (like in libre-office)

    Preferably only in .txt files.

    1 Reply Last reply Reply Quote 0
    • G
      guy038
      last edited by Sep 22, 2024, 1:01 PM

      Hello, @carsten88 and All,

      Surely, some guru guys on this forum, versed in Python, could create a script for this purpose ! Unfortunately, I’m not part of them -:(


      However, here is a regex search/replacement that you could run, once your text is completed :

      • SEARCH ([.?!])\x20*(\w)

      • REPLACE \1\x20\U\2


      Notes : This regex verifies and changes any text file as expected :

      • It rewrites, first, the last character of each sentence

      • Then, it normalizes any amount of space chars, even none, to one space only

      • And, finally, it rewrites the first letter of the next sentence in uppercase

      • If this letter is already written as uppercase, nothing is modified !

      Best Regards,

      guy038

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