Community
    • Login

    Auto-capital sentences in .txt

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 459 Views 1 Watching
    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 Offline
      carsten88
      last edited by

      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
      • guy038G Offline
        guy038
        last edited by

        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

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors