[Scilab-users] Extracting numerical an text data from gmx files

Samuel Gougeon sgougeon at free.fr
Mon May 22 01:14:01 CEST 2017


Hello,

Le 22/05/2017 à 00:32, Jens Simon Strom a écrit :
> Hi,
> I want to extract lat, lon and <rte>-name from gmx files. See the 
> following reduced example:
> -----------------------------------------------------------------------------------------------------------------------------------------
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?><gpx 
> xmlns="http://www.topografix.com/GPX/1/1" creator="MEDIA-TOURS" 
> version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:schemaLocation="http://www.topografix.com/GPX/1/1 
> http://www.topografix.com/GPX/1/1/gpx.xsd">
> <!--
> line of comments
> ...
> line of comments
>  -->
> <rte>
> <name>route_1</name>
> <rtept lat="52.00424932154729" lon="8.875365257263184">
> <name>1 Start</name>
> </rtept>
> <rtept lat="52.00319255643224" lon="8.878369331359863">
> <name>11 station</name>
> </rtept>
> <rtept lat="52.00271700399025" lon="8.879871368408203">
> <name>111 destination.</name>
> </rtept>
> </rte>
> </gpx>
> ------------------------------------------------------------------------------------------------------------------------------------
> lat and lon  should be collected as numerical colum vectors, name as a 
> colum of strings.
>
> Which commands would you recommend? Is reading by mgetl and retrieving 
> by regexp recommendable?

xmlXPath() is made for parsing xml documents and extracting selected 
informations.
getPreferencesValue() may also help. It is based on xmlXPath()

HTH
Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170522/1958e05c/attachment.htm>


More information about the users mailing list