shell problem "tail"

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.

“:~> tail -f /home/hik/Dokumenter/hik.odt
styles.xml�Zݏ�6���PѾɒ�uv��ӇE�Kz�%w�-�e�Hj��_�/��%��]��Y �9Ù�o����??���sA”

Hi
I would guess it’s the file encoding. What does the beginning of the file indicate the encoding is, ISO or UTF?

What it your environment set to?


locale

You might have to use the iconv command to change it.

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…


DD http://tinyurl.com/SUSEonDW

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

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)


DD http://tinyurl.com/SUSEonDW

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)


odt2txt gutenprint-users-manual.odt | head -n 20

,

Gutenprint 5.2

User's Manual

Robert Krawitz

October 18, 2008

Gutenprint 5.2 User's Manual

Copyright © 2000-2008 Robert Krawitz

Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.2 or any later version published by the Free Software
Foundation with no invariant sections, no Front-Cover texts,
and no Back-Cover texts.


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

I managed to cripple the code tags - sorry.

No problem, Martin, fixed.

Great, thank you.

thank you both. there is much more to learn, I see. i most try some more.

On 02/16/2012 04:36 PM, hhbuur wrote:

> there is much more to learn

ha! that gets my Understatement of the Week Award!!


DD http://tinyurl.com/SUSEonDW
*