diff --git a/README.md b/README.md index e62607f..50ccf49 100644 --- a/README.md +++ b/README.md @@ -38,4 +38,13 @@ chmod +x expanseR bash expanseR -o /path/to/your/input/directory -i /path/to/your/output/directory ``` -You can also use R script in standalone, you will have to specify your folders in the r script. \ No newline at end of file +You can also use R script in standalone, you will have to specify your folders in the r script. + +## Renaming files + +You can rename your files before converting them using the bash script `batch_rename.sh`. You will have to switch the parameter in it such as vigie-chiro prefix +(e.g +```bash +vigie_prefix="Car721035-2021-Pass0-Z2" +``` +) and device prefix. diff --git a/batch_rename.sh b/batch_rename.sh new file mode 100755 index 0000000..f485ac6 --- /dev/null +++ b/batch_rename.sh @@ -0,0 +1,18 @@ +#!/bin/bash +vigie_prefix="Car721035-2021-Pass0-Z2" +device_prefix="-AudioMoth-247AA5015FDF286B-" +prefix="$vigie_prefix$device_prefix" +echo "Adding $prefix" +extensions=('WAV', 'wav') +n=`ls | wc -l` +i=1 +for extension in "${extensions[@]}" +do + for item in `ls *.$extension` + do + echo "($i/$n) Renaming $item" + echo "mv $item $prefix$item" + $(mv "$item" "$prefix$item") + i=$((i+1)) + done +done