Extract Headers & Highlighted text

Discuss the word processor
Post Reply
DeedeeH
Posts: 1
Joined: Mon Mar 05, 2018 10:16 am

Extract Headers & Highlighted text

Post by DeedeeH »

Hi,
Is it possible to extract sections of text, or just the headers from an OpenOffice Writer document and insert those section or headers into another document

or

separate out sections of text into the same document,

based upon the style of headers used and or the highlighted colour?

Or failing that, and possibly as useful, have the Table Of Content display the headings with any colour attributes they may have been set with or the colour they have bee highlighted with?

For example, I have a 400k document that I need to edit which has been laid out with different headings, while many lines and sections have been highlighted in different colours to show different meanings to those parts.

What I need to do is isolate the different headings and coloured text, or possibly separating out just heading levels 1, 2 and 3, or certain colours, but always in the order they appear in the document.

Any help would be very appreciated.
Many Thanks
Deedee.

I have attached a small example document in the style I am trying to work with.
Attachments
Highlighted Headers Highlighted Text Extraction.odt
(16.17 KiB) Downloaded 73 times
Apache OpenOffice 4.1.2 - Windows 10 + XP
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Extract Headers & Highlighted text

Post by RoryOF »

By careful use of Find and Replace you could Find all lines in (say) red or with a particular format by pressing the Find All button. This will find and select the. The Ctrl C to copy them all, switch to a new document and Ctrl V to Paste them. If you do this multiple times, with differing Find parameters (set by dropping More options and selecting the Attributes and Parameter buttons), each tranche will be pasted after the previous tranche.

But _you_ will have to work out the detail - I'd suggest starting with a simple unimportant test file until you become familiar with how to use Find and Replace. When using your main file, use a copy of it, as you may damage it inadvertently.
 Edit: It may also be that a solution is to use a copy of the main file, and Find and Replace to remove the items you don't want, leaving all the desired items in their original order in the copy document. 
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Post Reply