renameGPXfile: Rename tracks.

View source: R/fileUtils.R

renameGPXfileR Documentation

Rename tracks.

Description

Rename gpx filenames but also, importantly, adjusting the track name in the <name> tag.

Usage

renameGPXfile(fold, fnew, pnew = "renamed")

Arguments

fold

Name for “old” GPX file.

fnew

Name for “new” GPX file.

pnew

Path after the working directory to contain the “new” GPX files.

Details

NONE YET

Value

None, used for side effect of writing new GPX files to the pth directory (and possibly deleting now old GPX files from the same directory).

Author(s)

Derek H. Ogle

Examples

## Not run: 
## Set working directory to where the files are
## Single file
renameGPXfile("NCTBF01","NCTBF001")

## Example of multiple files with a consistent file change pattern
olds <- c("NCTBF01","NCTBF07a")
news <- stringr::str_replace(olds,"NCTBF","NCTBF0")
cbind(olds,news)
renameGPXfile(olds,news)

## Example of multiple files to get new numbers padded with zeroes
olds <- c("NCTBF01","NCTBF07a")
news <- paste0("NCTBF",stringr::str_pad(seq_along(olds),width=3,pad=0))
cbind(olds,news)
renameGPXfile(olds,news)

## End(Not run)


droglenc/gpxhelpers documentation built on Dec. 12, 2024, 1:33 a.m.