LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > HMW
User Name
Password

Notices


Rate this Entry

Regex in LibreOffice

Posted 05-24-2016 at 05:06 AM by HMW

Although I prefer to work with text in editors, and not in word processors, I sometimes have to. Today I faced a massive editing task in a formatted .rtf document. I had to iron out some "bugs" in the text. Such as no space after a dot:
FOOBAR.Foobar.

Now, going through this massive text and look for these occurances manually clearly wasn't an option. I'd rather eat a cactus. Had it been "normal" - not formatted - text, I could have used regular expressions in Vim, or Sed or whatever tool. But since I could not "un format" the text it was a no-go.

Then I found that you could actually use regular expressions in LibreOffice. The syntax is a little different than in Sed for instance, but the differences are well documented here.

So, instead of doing this in Sed:
Code:
's/\.\([A-Z]\)/. \1/'
We do this in LibreOffice:
Code:
[Search for] \.([A-Z])
[Replace with] . $1
As you see, not all too different. This (and other) use of regular expressions saved me (and my employer) literally hours of work.

So, thank you LibreOffice, I will be kinder towards you in the future!
Posted in Uncategorized
Views 2413 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 12:40 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration