Forum Posts

Carlos Abrahams
Jul 26, 2018
In Device Support
Hi all, Not sure if someone has done this here already, but I've created some R code to batch rename a folder of AudioMoth files to apply the date and time they were created. Hope this is of use to others: #Convert filenames of AudioMoth to date and time of creation library(tidyverse) #Set directory to folder containing files setwd("~/Dropbox (Baker Consultants)/AudioMoth_Rename") #Change this to wherever your files are located Audiomoth_Dir <- "~/Dropbox/AudioMoth_Rename" #Generate list of files present within the folder file_list <-list.files(Audiomoth_Dir, pattern = "*.WAV", full.names = FALSE) #Generate vector of creation dates and times wav_file_info <- new_names <- as.character(wav_file_info$mtime) #Rename files file.rename(from = file_list, to = str_c(new_names,".wav"))
Carlos Abrahams
More actions