Connect single word in a paragraph to preceding and following paragraphs, using AltSearch in LibreOffice Writer
Let me say first that this will likely be a hack that most of you will never need, but for those who do need it, it's a godsend.
Background
I convert a LOT of public domain books from their original formats (pdf, epub, txt, etc.) into cleaned-up, easy-to-read and easy-to-use formats, mostly into .odt files. One of the sources of those Public Domain files is Early English Books online. This fix is predicated on EEBO as the source material, but anyone who uses any method of converting text from one format to another might have a need for this fix.
Notice
The fix is predicated on (1) the use of LibreOffice Writer, and (2) the installation of of the LibreOffice add-in "Alternate Search and Replace" (AltSearch).
The Issue
Unfortunately, when I search for a book on EEBO, then choose to copy "All Text" and paste it into a new LibreOffice Writer (.odt) document, most likely the word for which I searched in EEBO, in this case "God," is left hanging out in individual, one-word paragraphs.
The Need
What I need is to be able to do a mass replace (832 instances) of the one-word "God" paragraphs, so that ^God$ (using Regular Expressions) becomes connected to both the preceding and following paragraphs. Here's what those pesky paragraphs look like:
This is the first part of the paragraph to which I want the wordGodconnected to both the first and last parts of the paragraph.
This is what the end result should look like:
This is the first part of the paragraph to which I want the word God connected to both the first and last parts of the paragraph.
I want to pause here and say that, while frequently I use LO Writer's baked-in"Regular Expressions" function within the standard Find and Replace, I could not use that method to figure out how to do what I wanted to do, so I turned instead to the LO Writer add-in, "AltSearch."
The Fix
So, here's what the fix looks like, using AltSearch.
Note that in the Replace field the word God is preceded and followed by single spaces that do not appear in the image above. which results in a bunch of double-spaces that are much easier to mass-clean-up, rather than, in this case, having to go back and add a single space before and after 832 instances of the word God.
Comments
Post a Comment
Only comments that improve or disprove the contents of the posts on this blog will be approved. Opinions and speculations generally will not be approved. "Self-serving" links will not be approved. Product and advertising links will not be approved, but plain text recommendations might be approved. No form of vulgarity or cursing will be approved. No personal disparaging remarks will be approved. All comments become the property of this blog immediately upon the member's/reader's posting of the comment. All comments may be rejected or edited without recourse to or by the commenter. By posting, you agree to hold harmless this blog, its owner, editors, administrators and contributors, even if your post is approved as-is.