I have a folder with thousands of files in this format
- filenameA - 1.ext
- filenameA - 2.ext
- filenameB - 1.ext
filenameA - 1.ext filenameA - 2.ext filenameB - 1.ext andand sometimes filenameB - 02.ext
- filenameB - 02.ext
I need a script that will read the files and create a single folder with each distinct filename before the " - #.ext" and then add all files with that same name into the folder.
From the example above I would have two folders 1)filenameA filenameA 2)filenameB filenameB - each with two files in them. The actual data has thousands of files and each group can have 1 to 50ish files, with sequential numbers added to the end.
Thank you!