Bulk renaming of GPX routes to match filename

Discussion related to Garmin BaseCamp software for Windows
Post Reply
Spiney
Posts: 65
Joined: Thu Apr 04, 2019 9:35 am

Bulk renaming of GPX routes to match filename

Unread post by Spiney »

I have a large set of downloaded GPX files in a folder and each of which contain a single route. The GPX filenames can of course be easily edited. Using JaVaWa RTK one can see the assigned names of each route extracted from the <name> field inside the file. I want to change the contents of the <name> field to match the GPX filename so they are the same.

At present I either have to import each route into Basecamp, cut and paste the filename into the properties box, then export the route to create a new GPX file with the same name (or of course use a text editor).

Does anyone know of a utility that has the functionality to overwrite the contents of the first <name> field with the filename either singly or preferably as a batch?
User avatar
GPSrChive
Site Admin
Posts: 3882
Joined: Fri Jan 20, 2017 11:29 pm

Re: Bulk renaming of GPX routes to match filename

Unread post by GPSrChive »

We use Notepad++ to do large batch editing of text files, which is all any GPX file is. But practice first on a copy of a file to be sure you have everything configured correctly before applying to a large number of files. We have had some extra fun before going back and correcting mistakes!
Spiney
Posts: 65
Joined: Thu Apr 04, 2019 9:35 am

Re: Bulk renaming of GPX routes to match filename

Unread post by Spiney »

Thanks gpsrchive - I too use Notepad++ to edit individual text files. Good advice about backups !!

Did you use Notepad++ by running a macro to process a batch of files or did you use a Command line?
User avatar
GPSrChive
Site Admin
Posts: 3882
Joined: Fri Jan 20, 2017 11:29 pm

Re: Bulk renaming of GPX routes to match filename

Unread post by GPSrChive »

Notepad++ is very powerful.

We open multiple files, and then search globally for specific text strings and replace them all.

May not be possible to copy the actual file name into the <name> tag now that I think about it.... At least not without a batch file.

How many GPX files are you renaming?
Spiney
Posts: 65
Joined: Thu Apr 04, 2019 9:35 am

Re: Bulk renaming of GPX routes to match filename

Unread post by Spiney »

They come in batches of 30 to 40 files and there could be quite a lot of batches in future to edit.

The GPX route names are sometimes but not always the same, so a global find and replace approach may not work?
Post Reply

Return to “BaseCamp (PC)”