Skip to content

Instantly share code, notes, and snippets.

@typebrook
Last active July 26, 2020 16:19
Show Gist options
  • Select an option

  • Save typebrook/b984a04cdfc41b8c685e5de6a7383100 to your computer and use it in GitHub Desktop.

Select an option

Save typebrook/b984a04cdfc41b8c685e5de6a7383100 to your computer and use it in GitHub Desktop.
Merge all <trkseg> into a single <trk> in gpx file. Donload exe file at https://git.io/JfQeW #sed #gpx #track #trk #trkseg #bat #磐石

Make .EXE file on Windows for GPX track merging

  1. Get bat-to-ext-converter and sed
  2. Open bat-to-ext-converter, and wrap merge.bat, sed.exe, merge.sed into a single exe file
  3. Run signtool /a /tr http://tsa.starfieldtech.com merge.exe to sign exe file
FOR %%f IN (*.gpx) DO sed.exe -f merge.sed %%f > merged_%%f
/<\/trk>/ {
:a
N
/<trkseg>/! ba
s/.*\n//
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment