Note:

I need some help.
I’m looking for a technique to rename a bunch of files and folders.

2005_03_19_this_is_the_filename.md -> 2005/03/this_is_the_filename/index.md
2007_07_23_another_filename.md -> 2007/07/another_filename/index.md
2021_01_12_filename.md -> 2021/01/filename/index.md

Here’s the regex I want to use:

Webmentions

NameChanger was something I used to use for files and that worked well. Was free if I remember.

Thanks for your help Ben. Does NameChanger deal with folder name too ?

Name
Cédric Aellen
Published
Url
twitter.com

Bulk Rename Utility has a LOT of options that should be able to help

Name
Philip Pinea
Published
Url
twitter.com

I tried it and it seems you can't create/organize folders based on filenames. It's a shame because that's exactly the renaming I wanted 😢

Name
Cédric Aellen
Published
Url
twitter.com

@aral I managed to do it. Here's the command I used: `$ rename -p 's~(\d{4})_(\d{2})_\d{2}_(.+)(\.md)$~$1/$2/$3/index.md~' *.md`

@aral I managed to do it. Here's the command I used: `$ rename -p 's~(\d{4})_(\d{2})_\d{2}_(.+)(\.md)$~$1/$2/$3/index.md~' *.md`

On a mac, there is a utility called Automator, Which you can use for batch jobs.