I am looking for:
- a way to search inside odt files (i.e. search for contents, not name)
- that does not require any kind of indexing
- that is graphical and very user-friendly (for a relatively old person, who does not like computers much)
I know that it is possible to have 1) and 2):
for x in `find . -iname '*odt'`; do odt2txt $x | grep Query; done
works well enough, and it's pretty fast. But I wonder if there is already a good solution that does this with a GUI (or can be adapted to do this easily)
Solution using a yad script
Overview
Unfortunately there's no existing GUI option that would be able to search through LibreOffice documents without creating an index first (e.g. Recoll, Tracker). The closest one I found was
gnome-search-tool
but it only supports plain text files.Because I was looking for the same type of functionality a few months ago I decided to sit down and see what I could come up with myself. So, without further ado, here's the script I wrote:
ODT finder
Dependencies
ODT finder uses unoconv to convert LO documents to plain text. The GUI is based on yad, a powerful Zenity fork. Yad isn't available in the official repositories, yet, but you can install it from a webupd8 PPA.
The following commands should take care of all dependencies:
Installation
Copy and paste the contents of the code box above into a new text file, name it whatever you want and make it executable. You can integrate the script with your system in various ways, e.g. by assigning a launcher or using it as a Nautilus script.
Usage
First time launching the script you will be greeted with an entry dialog for the folder you want to search through and the search term:
Click on 'OK' to start the query. This might take a while:
When the result window pops up you can double-click on any of the entries to open it in your default viewer (LibreOffice, generally). You can do this for more than one file:
The script will exit after hitting OK, Cancel, or closing the window.
There are some basic checks to guide the user and warn them if something went wrong:
Hopefully this fits the bill ☺.