Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


Hi :)
I could easily be wrong but I think the first "echo" could use updating?
It doesn't affect how it runs or any processing because the "echo" is only
regurgitated into the display for human being to read.  It's where you'd
put "hello world" if you wanted the display to just show that.  I'm not
sure if i've explained that well or just made it as clear as mud because
i'm guessing everyone else already knew that, right?

Even though it's not processed by the machine and is just for human-readers
to see, it's still (imo) handy for it to give the correct information.  So,
probably change

echo "Usage:   searchodt   searchterm"

to

echo "Usage:   search_odt_files    searchterm"

or else change the scripts' file-name back to searchodt as it appears to
have been as some previous point in the scripts' 'life'.
Regards from
Tom :)





On 24 August 2014 19:29, Paul <paulsteyn1@afrihost.co.za> wrote:

Try changing the line:

     unzip -ca "$file" content.xml | grep -ql "$1"

to:

     unzip -ca "$file" content.xml | grep -qC 10 "$1"

the "-l" to grep makes it show only the names of files that match, not
the content. The "-C #" gives # lines of context around the match. Or
you could use "-B #" and "-A #" to print # lines of leading and
trailing conext, respectively.

You could also make a script to pull the contents of all the files and
concatenate them in such a way that you can use Writer to do find
inside one big document, but that would be considerably harder. Try
this first.


Paul



Disclaimer: I haven't actually tested this, just done a "man grep", but
I think the syntax is right...




On Sun, 24 Aug 2014 18:16:35 +0000 (UTC)
Maurice <maurice@bcs.org.uk> wrote:

On Sun, 24 Aug 2014 11:44:31 -0500, Don Pobanz wrote:

I find it very useful for finding a word or phrase within my odt
documents.

Thank you, Don, but that only shows which files contain the
search string. (It's likely that all files in the list will contain
at least one occurrence of the string.)

That would be a start, but what I am looking for is a means of seeing
the string as if Writer was showing the file contents, so that I can
see the surrounding text.

(Equivalent to joining all the doc's into one big file, then doing a
Find.   Perhaps I shall have to do the joining manually...)



--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems?
http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be
deleted



-- 
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.