Sort folder based on filename inside the folder?
Posted: Fri Jun 18, 2021 5:51 pm
I have folders with one XML-file and two PDF-files like this
-Folder1
--AAA_I.pdf
--AAA_C.pdf
--CCC.xml
-Folder2
--BBB_I_Lex.pdf
--BBB_C_Lex.pdf
--CCC.xml
As you can se Folder1 does not have "_Lex" in the end of the pdf-files. But the pdf-files in Folder2 have "_Lex" in the end.
I want to sort all the folders (not only the files) that have pdf-files with lex inside it to one folder and all folders that doses not have lex in the file to another folder. The folder should after sorting contain the same files, one XML and two pdf-files.
-Folder1
--AAA_I.pdf
--AAA_C.pdf
--CCC.xml
-Folder2
--BBB_I_Lex.pdf
--BBB_C_Lex.pdf
--CCC.xml
As you can se Folder1 does not have "_Lex" in the end of the pdf-files. But the pdf-files in Folder2 have "_Lex" in the end.
I want to sort all the folders (not only the files) that have pdf-files with lex inside it to one folder and all folders that doses not have lex in the file to another folder. The folder should after sorting contain the same files, one XML and two pdf-files.