On Fri, 23 Jan 2004, Norbert Kamenicky wrote:

> > The OpenOffice file format is zipped xml.  So you should just be able to
> > use zgrep, although it will miss any phrases that have extra formatting in
> > them, such as a phrase in which part of it is underlined.  Also, I'm not
> > sure how that will handle newlines.
> >
>
> Since all the text is in one xml formated line, grep will
> print complete text (if matches).
> Some workaround is needed before grep ...
>
> these steps are needed:
>
> 1. unzip "content.xml" from OOo document
> 2. convert it to text format
> 3. grep
>
> try this (not tested)
>
> unzip -p your-OOo-document content.xml \
> | sed "s/<[^<>]*>/\n/g" \
> | grep string

I'd use 'fold -s' instead of the sed line.
I've never looked at an OOo file, so I didn't know it was all on a single
line.  I suppose that saves a little bit of space, but it's a bit
inconvenient.

-- 
CAUTION: Product will be hot after heating


--
[EMAIL PROTECTED] mailing list

Reply via email to