I deployed passive acoustic recorders to detect animal calls but on one of my devices the date & time settings got messed up and reverted to the default (Jan 1, 2000). And then the device recorded for a month, writing 20-min files that are day & time stamped. e.g., file name is swift1_20000101_020000.wav (deviceName_YYYYMMDD_HHMMSS). And now I reeeeally don't want to have to manually rename 2000+ individual files.
I know the actual start date & time from my field notes and I'm wondering if there's a way to input that actual start date/time and have all the files shift off of that. So swift1_20000101_000000 would become swift1_20220617_093000, swift1_20000101_002000 would become swift1_20220617_095000, and so on in some sort of loop.
Any ideas? I know you can rename files with file.rename(), paste0(), etc but I would need a function that iterated on all files within the directory sequentially and I haven't been able to find something that will do it. Any thoughts or ideas would be much appreciated!
(Also posted on Stack Overflow).
4 July 2022 6:22am
On a Mac, I use "SetEXIFData" by Marc Vos to increment file or EXIF dates. You can then pull the file name from the date. I'm sure there are Windows and Linux equivalents.
However, what I would really like is a simple way to scale file times where I have the first date and I then know that the last time stamp was offset forward or backwards because of poor timekeeping by the device. Maybe there is something in R or Python that will do it.