Donate SIGN UP

Breaking Up Text To Put Each Sentence On A Separate Line?

Avatar Image
joko | 21:39 Sat 24th Sep 2022 | Technology
3 Answers
Is there a function - or even a name for - automatically splitting up a block of text by starting another line after every full stop?

ive never needed to do it before, so cant think how it could be done.

I'm using Libre Office, but could move it into any other program

any ideas?

thanks :)
Gravatar

Answers

1 to 3 of 3rss feed

Best Answer

No best answer has yet been selected by joko. Once a best answer has been selected, it will be shown here.

For more on marking an answer as the "Best Answer", please visit our FAQ.
this may be of help
https://techwelkin.com/remove-paragraph-break-ms-word

I wd have thought it was possible to program a 'letter' as a full stop and carriage return ( period, carriage break)

they suggest doing it en clair and then using find replace to replace every full stop as .+CR

then I did a cross word - sozza I am geeky but not THAT geeky
I've been trying a lot of playing about with LibreOffice Writer and I seem to be almost there with what you want. So I'll give you what I've got so far and leave you to see if there's any way to get it perfect.

My approach has been to try to replace a full stop with a full stop and a line break. I can get a full stop replaced by a line break but only when losing the full stop from the resultant text. It's all to do with 'regular expressions', so you'll need this page of info:
https://help.libreoffice.org/Common/List_of_Regular_Expressions

To get as far as I've got up until now, start by pressing Ctrl and H together, to bring up the 'search & replace' dialogue box.

Under 'Other options', place a tick next to 'Regular expressions'.

In the 'Find' field, type \.[:space:]

In the 'Replace' field, type \n

Click 'Replace all'.

As you'll see, that will get you very close to where you want to be but it needs a bit more work to finish the job off properly. I'll leave you to see if there's any way that it can be done!
I do this quite often.

You need to find the control codes - it could be ^p or \p - might be \n

https://youtu.be/4aP1TtSw_QY

What I would do would be an initial search and replace for a double space - replacing it with a single space. Do this until it tells you no changes found.

Then do a search and replace for a full stop followed by a single space. Replace it with a full stop and a character that is NOT used in your document eg. dollar sign.

Then do another search and replace for the .$ Replace it with .^p$ (assuming ^p is the control code)

Now replace all $ with a blank.


As you get used to doing it you can reduce the number of steps.

1 to 3 of 3rss feed

Do you know the answer?

Breaking Up Text To Put Each Sentence On A Separate Line?

Answer Question >>

Related Questions

Sorry, we can't find any related questions. Try using the search bar at the top of the page to search for some keywords, or choose a topic and submit your own question.