Sort into folder based on part of the file name

I have almost found the solution elsewhere on the forum but my task is slightly different. What I'm attempting to do in this instance is sort individually downloaded font files into a folder with the overall name of the font and then into sub-folders based on type. For example:
Downloaded filename is Roboto-italic.woff
Create/sort into a folder named Roboto
Create/sort into a sub-folder named woff
It's the initial folder name that's foxing me; the sub folders are simple as I just base it on extension. I attempted to use the custom attribute but couldn't wrap my head around it.
Downloaded filename is Roboto-italic.woff
Create/sort into a folder named Roboto
Create/sort into a sub-folder named woff
It's the initial folder name that's foxing me; the sub folders are simple as I just base it on extension. I attempted to use the custom attribute but couldn't wrap my head around it.