Re: xml-Datei zerlegen
On Wed, Jun 10, 2009 at 12:51:56PM +0200, Christian Knorr wrote:
> ich muss eine xml-Datei in seine Bestandteile zerlegen. Genauer gesagt ist es
> eine gpx-Datei die mehrere Wegpunkte aus einem GPS-Gerät enthält.
> Ich habe sie schon in "header.xml", "footer.xml" und "AllWayPoints.xml"
> zerlegt. Das Problem ist nun der Abschnitt aus "AllWayPoints.xml" der so
> aussieht:
[...]
> Wie kann ich das zuverlässig mit bash in Abschnitte abspeichern? Also:
> Erste Versuche mit while, cat, head und tail schlugen fehl weil sie eine feste
> Abschnitt-Länge (7 Zeilen) voraussetzen. Es gibt aber WPs ohne Höhenangabe
> (<ele>) so sind es nur 6 Zeilen und alles Folgende ist kaputt.
Vielleicht sind die 'xml-twig-tools' was für Dich?
fstreitz@Frank-2:~$ aptitude show xml-twig-tools
Package: xml-twig-tools
New: yes
State: not installed
Version: 1:3.32-3
Priority: optional
Section: perl
Maintainer: Bart Martens <bartm@debian.org>
Uncompressed Size: 152k
Depends: perl, libxml-parser-perl, libxml-twig-perl
Description: Command line tools for processing XML documents
These tools are included:
* xml_spellcheck : spellcheck XML files skipping tags
* xml_merge : merge back files created by xml_split
* xml_pp : XML pretty printer
* xml_grep : grep XML files using XML::Twig's subset of XPath
* xml_split : split big XML files
Homepage: http://www.xmltwig.com/
HTH Frank
--
gpg public key available from keyservers
Please use the DSA- and not the RSA-key!
Reply to: