
renamer-index-dir
This is a renamer replace chain plugin - see this tutorial to learn how to use renamer plugins.
Replaces the {{index}}
token (like the built-in renamer behaviour) but resets the counter for each folder visited.
In the example below, Windows users should use double instead of single quotes. Remove the --dry-run
flag to rename the files on disk.
$ npm install -g renamer renamer-index-dir
$ tree
.
āāā folder1
āĀ Ā āāā one
āĀ Ā āāā two
āāā folder2
āĀ Ā āāā one
āĀ Ā āāā two
āāā one
āāā two
2 directories, 6 files
$ renamer --chain find-replace --chain renamer-index-dir --find '/$/' --replace '{{index}}' --dry-run */*
āļø folder1/one ā folder1/one1
āļø folder1/two ā folder1/two2
āļø folder2/one ā folder2/one1
āļø folder2/two ā folder2/two2
$ tree
.
āāā folder1
āĀ Ā āāā one1
āĀ Ā āāā two2
āāā folder2
āĀ Ā āāā one1
āĀ Ā āāā two2
āāā one
āāā two
2 directories, 6 files
Ā© 2018-21 Lloyd Brookes 75pound@gmail.com.