Yet Another Cycling Forum

General Category => The Knowledge => GPS => Topic started by: andyoxon on 25 November, 2016, 08:34:33 am

Title: Editing a gpx file?
Post by: andyoxon on 25 November, 2016, 08:34:33 am
On my date faulty 'back-up' Vista HCx, I need to replace the the date in the whole gpx file track log.  I can do this easily in notepad, but can't resave as a gpx.  How can I do a "find and replace all" date data in every line at once, and convert/save as a useable gpx file?
Title: Re: Editing a gpx file?
Post by: PaulF on 25 November, 2016, 08:39:24 am
Thought that Notepad will let you save with any extension?


But if you can't just edit in notepad, save as a .txt file, close the file and change the suffix in Explorer.
Title: Re: Editing a gpx file?
Post by: andyoxon on 25 November, 2016, 09:00:42 am
Thanks Paul - yes tried that last night, simply changing .txt to .gpx, but ridewithgps rejected it.  Perhaps there was some other issue with the file.
Title: Re: Editing a gpx file?
Post by: frankly frankie on 25 November, 2016, 09:12:34 am
Aside from obvious things (like wrongly formatted dates) the file may have acquired some white space or a c/r at the end, which can cause problems.  Delete right back to the end of the closing tag.  Or you can 'clean' the file by running it through GPS Visualizer or some such - though that will stamp it with a different origin so it no longer looks like an Etrex-produced file.  (Possibly GPS Vis can also do the re-dating - it can certainly do time offsets, under the 'advanced' options.)

In any case, Notepad is notoriously inadequate software.  You owe it to your PC to install a replacement such as Editpad
https://www.editpadlite.com/ (https://www.editpadlite.com/)
which is free and about 100x better than Notepad.   (Some others are even better - I use Textpad - but may not be free.)
Title: Re: Editing a gpx file?
Post by: fuaran on 25 November, 2016, 11:57:52 am
You could use GPSBabel, with the 'move' filter, to shift all of the dates by the same amount.
Title: Re: Editing a gpx file?
Post by: Dibdib on 25 November, 2016, 01:41:14 pm
In Notepad's Save As dialog I think you need to type in
Code: [Select]
"mytrackname.gpx" rather than
Code: [Select]
mytrackname.gpx otherwise it'll think you mean
Code: [Select]
mytrackname.gpx.txt
 :facepalm:
Title: Re: Editing a gpx file?
Post by: andyoxon on 25 November, 2016, 02:57:26 pm
Ok thanks all, I've managed to find & replace date, save and upload.   :)  Will give editpadlite a look...
Title: Re: Editing a gpx file?
Post by: Phil W on 26 November, 2016, 08:52:59 pm
There's also Notepad ++ and Nodepad XML which are worth a look. I have both installed.
Title: Re: Editing a gpx file?
Post by: Moleman76 on 27 November, 2016, 02:03:58 am
Wordpad has features which Notepad didn't seem to used to have; search and replace, etc. 

Haven't used NP for quite a while, so maybe it is more up-to-date than I recall, and my comment can be cheerfully ignored
Title: Re: Editing a gpx file?
Post by: Dave_C on 27 November, 2016, 11:14:14 am
I just rename in File Manager to *.gpx and all is good.

Sent from my A0001 using Tapatalk

Title: Re: Editing a gpx file?
Post by: wajcgac on 27 November, 2016, 04:03:47 pm

I have found GPS Track Editor to be very useful.

It will sort out timestamps for you as well as a lot more.

http://www.gpstrackeditor.com/ (http://www.gpstrackeditor.com/)

Title: Re: Editing a gpx file?
Post by: fhills on 02 December, 2016, 09:21:18 am
Kind of a related question.

I now and again have a gpx file which won't work, usually because I have done some tinkering and mucked up its " grammar" (sorry can't remember the computer term - syntax?). Though not uber techy i usually manage to find the problem, maybe a space or improperly closed "bracket". Are there any progs, possibly named above, which you can just run a gpx file through to find and highlight issues?
Title: Re: Editing a gpx file?
Post by: Phil W on 03 December, 2016, 10:27:12 am
Kind of a related question.

I now and again have a gpx file which won't work, usually because I have done some tinkering and mucked up its " grammar" (sorry can't remember the computer term - syntax?). Though not uber techy i usually manage to find the problem, maybe a space or improperly closed "bracket". Are there any progs, possibly named above, which you can just run a gpx file through to find and highlight issues?

Try an XML validator

http://www.w3schools.com/xml/xml_validator.asp
Title: Re: Editing a gpx file?
Post by: fhills on 04 December, 2016, 09:21:11 pm
Many thanks for that Phil