Search Through OpenOffice and LibreOffice Writer Documents

OpenOffice Writer and LibreOffice Writer save documents in the OpenDocument Text (ODT) format. ODT files are technically ZIP archives that contain XML and assorted files. While ODF is an open format in principle, the XML it uses is still really complicated. PowerGREP can convert ODT files to plain text so you can easily search through them, without having to deal with the XML. PowerGREP can also reconvert its plain text conversion back into the original ODT file so you can easily search-and-replace through ODT files.

StarOffice Writer saved files with an SXW extension. These use a format that was a precursor to the ODT format. PowerGREP's built-in converter for ODT files also supports SWX files.

File Format Configurations for OpenOffice and LibreOffice Writer Documents

To be able to search through OpenOffice Writer and LibreOffice Writer documents as if they were plain text documents, you need to set the "file formats to convert plain text with" on the File Selector panel to a configuration that uses the option "Use PowerGREP's built-in decoder to convert files to plain text" for the file format "OpenDocument Text (ODT)". Default configurations that use this options are "proprietary formats", "writable proprietary formats", "all formats", "all writable formats", "attachments & proprietary formats", "attachments & writable proprietary formats", "attachments & all formats", and "attachments & all writable formats".

To be able to search-and-replace through ODT files, there's an additional requirement. The configuration should not enable any read-only converters. Default configurations that use the built-in converter for ODT and don't use read-only converters for any other formats are "writable proprietary formats", "all writable formats", "attachments & writable proprietary formats", and "attachments & all writable formats".

With one of these configurations selected on the File Selector panel, you can use the Editor|Open menu item to open a DOCX file and edit it in PowerGREP's built-in editor. Though PowerGREP won't show you the file's formatting, it will be preserved when you save the file.

If you want to search only through OpenOffice Writer, LibreOffice Writer, and StarOffice Writer documents, enter the file mask *.odt;*.sxw in the "include files" box on the File Selector panel. If you leave the "include files" and "exclude files" boxes blank, then PowerGREP searches through the plain text conversion of all file formats enabled by the configuration, as well as through the raw contents of all files that are not recognized as one of those file formats.

These file selections are available in the PowerGREP5.pgl library as "Office: Search through OpenOffice/LibreOffice/StarOffice Writer documents (ODT/SXW files)" and "Office: Search-and-replace through OpenOffice/LibreOffice/StarOffice Writer documents (ODT/SXW files)".

To indicate which ODT files to search through, click on the folder that contains them in the "folders and files" tree. Then select Include File or Folder or Include Folder and Subfolders from the File Selector menu.

Finally, prepare and execute your search or search-and-replace on the Action panel.