hi i am working my way through these document “SUSE-Linux-Toolbox-1000-Commands-for-openSUSE-and-SUSE-Linux-Enterprise.pdf”
and haw com to chapter 3 using shell. i the using of the “tail” command i came a pond these problem whit reading a document ind the “odt styles”. haw do i change the “styles” so i can reed my document.
On 02/15/2012 06:36 PM, hhbuur wrote:
>
> problem whit reading a document ind the “odt
> styles”. haw do i change the “styles” so i can reed my document.
tail is a command which reads out to the console exactly what it ‘sees’
in the specified file whether if it is a log file in pure ascii text or
something other…
and, .odt files (and other Libre/OpenOffice files) will invariably not
be pure ascii text and is there unsuitable for use with tail…unless
of course you really want to see what is inside…
try it on a plain text file, or to cut off the beginning of a LONG
terminal output, like say compare the output of these two commands:
dmesg | tail
dmesg
if you knew what you were wanting to see fell at the end, it is so
much quicker to just push that out…
An odt file is essentially a zip file which contains several xml files.
In principle you can show the content with the unzip command and piping
that into your tail command.
unzip -c my_odt_file.odt content.xml | tail
content.xml is what contains the main text of the odt if I recall correctly.
–
PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
4.6.0 | GeForce GT 420 | 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.8.0 |
nVidia ION | 3GB Ram
Am 15.02.2012 19:18, schrieb Martin Helm:
> An odt file is essentially a zip file which contains several xml files.
> In principle you can show the content with the unzip command and piping
> that into your tail command.
>
>
> unzip -c my_odt_file.odt content.xml | tail
>
content.xml is what contains the main text of the odt if I recall correctly.
You will get a slightly better result if you pipe the xml through a
pretty printer (the xml command from the package xmlstarlet can do this)
cd /usr/share/gutenprint/doc/
unzip -p gutenprint-users-manual.odt content.xml | xml fo - | tail
results in
<text:p text:style-name="Text_20_body">
<text:span text:style-name="Strong_20_Emphasis">10. FUTURE
REVISIONS OF THIS LICENSE</text:span>
</text:p>
<text:p text:style-name="Text_20_body">The Free Software
Foundation may publish new, revised versions of the GNU Free
Documentation License from time to time. Such new versions will be
similar in spirit to the present version, but may differ in detail to
address new problems or concerns. See http://www.gnu.org/copyleft/.
</text:p>
<text:p text:style-name="Text_20_body">Each version of the License
is given a distinguishing version number. If the Document specifies that
a particular numbered version of this License "or any later version"
applies to it, you have the option of following the terms and conditions
either of that specified version or of any later version that has been
published (not as a draft) by the Free Software Foundation. If the
Document does not specify a version number of this License, you may
choose any version ever published (not as a draft) by the Free Software
Foundation. </text:p>
<text:p text:style-name="Text_20_body"/>
<text:p text:style-name="Text_20_body"/>
</office:text>
</office:body>
</office:document-content>
–
PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
4.6.0 | GeForce GT 420 | 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.8.0 |
nVidia ION | 3GB Ram
Am 15.02.2012 21:15, schrieb DenverD:
> On 02/15/2012 07:18 PM, Martin Helm wrote:
>
>> unzip -c my_odt_file.odt content.xml | tail
>
>
> kewl!! love learning from you (and the other smart folks here)
>
To be honest most people will not really be interested to see the
content as xml and are better served to install odt2txt which turns the
odt file into a plain text file.
For example (it will take a moment when the command converts the content)
–
PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
4.6.0 | GeForce GT 420 | 16GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.8.0 |
nVidia ION | 3GB Ram