A large number of font files (2728 files) are flattened in to a single folder.
I want to move all files belonging to the same font family into a folder where the folder name is the complete name of the font family.
For example in the following list of files:
Axle.otf AxleBold.otf AxleBoldItalic.otf AxleCondBold.otf AxleCondensed.otf AxleCondItalic.otf AxleExpanded.otf AxleExpBold.otf AxleExpItalic.otf AxleItalic.otf AxleNarBold.otf AxleNarItalic.otf AxleNarrow.otf AxleWide.otf AxleWideBold.otf AxleWideItalic.otf Distract.otf DistractBold.otf DistractBoldItalic.otf DistractCondBold.otf DistractCondensed.otf DistractCondItalic.otf DistractExpanded.otf DistractExpBold.otf DistractExpItalic.otf DistractItalic.otf DistractNarBold.otf DistractNarItalic.otf DistractNarrow.otf DistractWide.otf DistractWideBold.otf DistractWideItalic.otf Voltagio.otf VoltagioBold.otf VoltagioBoldItalic.otf VoltagioCondBold.otf VoltagioCondensed.otf VoltagioCondItalic.otf VoltagioExpanded.otf VoltagioExpBold.otf VoltagioExpItalic.otf VoltagioItalic.otf VoltagioNarBold.otf VoltagioNarItalic.otf VoltagioNarrow.otf VoltagioOutline.otf VoltagioWide.otf VoltagioWideBold.otf VoltagioWideItalic.otf
I want all the files that start with “Axle” to be in one folder named Axle; those that start with “Distract" to be in a folder named Distract; all “Voltagio" files to move a Voltagio folder, etc.
Basically, the shortest name of a font file is the base name of that font family and should be used to collect the family into a folder with that base name. The base name varies in length from about 4 to 12 characters.
Another issue is that some “families” consist of only one file and so I don’t want those to go into a separate folder but to remain at the root level of the destination folder.
Any help would be appreciated.