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


If the Python code were modified to also add filename with path and inject it at end of paragraph as URL.

It might be possible to re-direct python command output to a .txt file that could be opened by Writer.

I am not sure whether or not Writer could be set to recognize and "Open File URL" automatically to modify original document.

Hhhhhmmmmm


On 8/25/2014 10:03 AM, P. . wrote:
Try this, even if it isn't exactly an 'out of the box' solution, it
can be useful:
in few words, the script parses the xml file inside the .odt - in fact
an archive file, and search for a keyword after having extracted the
text part.

A short excerpt, from the page 3 of "Extract and Parse ODF Files with Python":
"In this particular program, I collect all the text as a list of
paragraphs, and then I search for the keywords passed in from the
command line. If the searched word matches, the paragraph is printed
out.

The text found in each <text:p> is Unicode text. You have to convert
this to normal text in order to print correctly and/or use in a
widget. The encode() command translates the Unicode to a printable
string. "


<http://www.linuxjournal.com/article/9347?page=0,2>


On 25 August 2014 15:31, Paul <paulsteyn1@afrihost.co.za> wrote:
Well, it does seem like all your mails do this, but not all mails from
this list exhibit this behaviour. Most mails from the list, even
replies, are addressed to the list. Yours are different in that they're
not addressed to the list, only CCd to the list. Some other people's
replies are the same, but I'd say not most.

When the mail is addressed to the list, or addressed to someone else and CCd
to the list, I can just click reply, but when the mail is addressed to
me personally and only CCd to the list clicking Reply replies to the
sender only.

I can only think that it's a difference in email clients and how they
handle list messages. The messages contain list headers, so most
clients, like mine, must pick that up and automatically reply to the
list, but some, like yours, must be ignoring those and replying to the
sender instead. I think.

So if I'm understanding the process right, it's not so much a problem
with how the list is set up (other than that it doesn't rewrite the
sender header), but rather with some clients not honouring the list
headers.



Paul



On Mon, 25 Aug 2014 14:08:01 +0100
Tom Davies <tomcecf@gmail.com> wrote:

Hi :)
Nope, it;s the standard way these mailing lists have behaved for a
long time now.

It used to be that people could just click on "Reply to" and their
message would go straight to the mailing list.  Now most
email-clients require people to click on "Reply to all ..." and the
mailing list's address is only in the "CC" rather than in the "To"
field.  Numerous people have grumbled about it in here but few bother
to post a complaint to the postmaster address and those that do just
seem to get agro for it.

One person here did try to show how he re-configured his own
email-client to get around the problem and a few of the other
longer-term people here might well have followed his lead but i am
not sure what effect that sort of thing has on non-LO emails.  Also i
kinda believe in the "Eat your own dog food" principle so that i stay
in touch with the problems normal users have when they first approach
this mailing list. Regards from
Tom :)






On 25 August 2014 13:56, Paul <paulsteyn1@afrihost.co.za> wrote:

Well, Maurice quoted from my mail, so I'm pretty sure he did
receive it.

Btw: Tom, your mail was addressed to me directly, and CCd to the
group, causing my default reply-to to go to just you (luckily I
noticed in time). Not sure why this happens for some messages, did
you do anything differently for your message?


On Mon, 25 Aug 2014 13:41:14 +0100
Tom Davies <tomcecf@gmail.com> wrote:

Hi :)
I suspect that Paul's post below has not yet arrived in Maurice's
time-line.

Email threads sometimes get a bit disjointed, especially if an
over-enthusiastic junk/spam-filter tends to carefully reject
anything with any hint of code in it!  However it could easily be
that someone starts from their older messages and work forwards
to newer and newer ones instead of the more sensible approach
(imo) of working from the newest posts backwards to the oldest.
By starting with the newest ones first i often find that older
posts have already been dealt with and can thus be safely ignored
even if they stir-up side-issues (which also might have already
been largely dealt with).


On the other hand it might be good if someone could test Paul's
script. Perhaps it's possible to combine the 2 ideas so that both
the file-name AND the few lines of surrounding text could be
output? Would that help?  Also it might be good to have the
output directed into a file rather than just onto the
command-line?

I really like Don Pobanz's answer and the way Paul was able to
help tweak it.  It felt like a return to what this mailing list
is largely about = collaborating to build-up a better answer
faster than the individuals had time to do on their own.  Good
work!! :))) 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



--
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.