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

Jens Simon Strom j.s.strom at hslmg.de
Mon May 22 00:32:37 CEST 2017


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?

The regex expression itself is no problem, e.g. 
(?<=(<name>))(\w|\d|\n|[().,\-:;@#$%^&*\[\]"'+--/\/®°°!?{}|`~]| 
)+?(?=(</name>))

I'm not asking for an executable function, just a smart choice of commands.

Kind regards, Jens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170522/0a1a2d01/attachment.htm>


More information about the users mailing list