I have a directory with files like these
2022-11-08-0001.gzip
2022-11-08-0002.gzip
2022-11-08-0003.txt
2022-11-08-0004.png
2022-11-08-0005.txt
2022-11-08-0006.txt
2022-11-08-0007.png
2022-11-08-0008.txt
2022-11-08-0009.txt
2022-11-08-0010.png
and want to split them into sub directories like so
/gzip
2022-11-08-0001.gzip
2022-11-08-0002.gzip
/png
2022-11-08-0004.png
2022-11-08-0007.png
2022-11-08-0010.png
/txt
2022-11-08-0003.txt
2022-11-08-0005.txt
2022-11-08-0006.txt
2022-11-08-0008.txt
2022-11-08-0009.txt
I found this short and sweet solution, but I could not customize it to my needs because the length of the file extensions vary. The base names of the files are of equal length, though.