[nSLUG] GPS Turn by Turn (Voice) and XML

Eri Ramos Bastos bastos.eri at gmail.com
Mon Jan 25 10:24:09 AST 2010


sed 's,[Hh][wW][yY],Hwy,g' file.xml > newfile.xml

Or use sed -i for in-place substitution.

Regards,
Eri Ramos Bastos

On Mon, Jan 25, 2010 at 9:53 AM, David Potter <dlpotter at eastlink.ca> wrote:
>
> My Garmin Nuvi GPS turn by turn  (voice) directions were often (but not
> always) using  "H W Y 111" instead of "Highway 111".
>
> The gps has file in the following format...
>
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <gtt xmlns="http://www.garmin.com/xmlschemas/GarminTextTranslation/v1"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.garmin.com/xmlschemas/GarminTextTranslation/v1
> http://www.garmin.com/xmlschemas/GarminTextTranslationv1.xsd" >
> <hdr>
>    <lang>British_English</lang>
>    <desc>British English</desc>
>    <type>Primary</type>
>    <sort>0</sort>
>    <cpage>65001</cpage>
>    <pnum>006-D0897-01</pnum>
>    <ver>2.60</ver>
>    <upperkbrd>ABCDEFGHIJKLMNOPQRSTUVWXYZ</upperkbrd>
>    <lowerkbrd>abcdefghijklmnopqrstuvwxyz</lowerkbrd>
> </hdr>
>
> <str>
>    <tag>TXT_TRF_EVENT_0001_Q0_STR</tag>
>    <txt>traffic problem</txt>
> </str>
>
> <str>
>    <tag>TXT_TRF_EVENT_0024_Q0_STR</tag>
>    <txt>bridge closed</txt>
> </str>
>
> <str>
>    <tag>TXT_Hwy__STR</tag>
>    <txt>Highway</tx>
> </str>
>
> <snip>
>
> ---------------
>
> "Hwy" in the last item appears to provide string substitution, and also
> seems to be case sensitive. A couple of weeks ago I edited the file to
> add some additional variations and was mostly successful in having the
> voice use "Highway" rather the "H W Y". The other day I happened to look
> at the screen in the middle of another outburst of "H W Y" and noticed
> the device was showing "HwY 111".....
>
> Can anyone help me figure out some way to use regular expressions (?) in
> the <tag> </tag> elements to sanitize case abnormalities and standardize
> the result across different map data...?
>
> David
>
> --
>
> _______________________________________________
> nSLUG mailing list
> nSLUG at nslug.ns.ca
> http://nslug.ns.ca/mailman/listinfo/nslug
>



More information about the nSLUG mailing list