Auto-capital sentences in .txt
-
How to make each sentence start with a capital letter as I type? (like in libre-office)
Preferably only in .txt files.
-
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, toone
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
-