Friday, July 08, 2011

OpenOffice Note: selecting all footnotes

The current version of OpenOffice writer does not directly support the extracting of all footnotes, but there are ways to get around this. First, footnotes can be selected by Edit | Find & Replace ..., and then choosing More Options, and ticking Search for Styles below. Choose Footnote as the style in the drop down list above, then press the button Find All. All foot notes will be highlighted, and then can be copied into clipboard. Second, when trying to paste the selected footnotes into a target file, it turns out that all new lines after footnotes are gone. This can be solved by the following trick.

(1) In the original document from which footnotes are extracted, select all footnotes in the aforementioned way.

(2) (Assuming that each footnote ends with a period) remove trailing space characters (if any) by using Find and Replace, ticking Current Selection Only and Regular Expression in More Options. Find all patterns: [ ]+$ (note the space between [ and ]) and replacing them with an empty string (by emptying textbox).

(3) Again select all footnotes in that document, and then use the same method is the previous step to replace pattern \.$ with .ENDOFPARAGRAPH. The special word ENDOFPARAGRAPH is used as a placeholder for newline.

(4) Use the method mentioned before to select all footnotes again now, and copy them and paste them into a new document.

(5) from the new document, use Find and Replace to replace all ENDOFPARAGRAH with \n, ticking Find Regular Expression under MoreOptions.

That will do the extraction. Use an Undo step to undo the insertion of placeholder words in the original document. Or simply replace them again with ''.

No comments: