Skip to contents

Helper function to parse site/grid/recorder identifier from filename using pattern capture groups or leading token prior to first underscore.

Usage

pam_extract_grid(filename, pattern = NULL)

Arguments

filename

Character, filename or base name.

pattern

Optional regular expression pattern (e.g., cfg$filenames$pattern).

Value

Character string identifier or "unassigned".

Examples

pam_extract_grid("G0059_20260405_183000.wav")
#> [1] "G0059"
pam_extract_grid("recording.wav")   # no recognisable identifier
#> [1] "unassigned"