Arduino with CH376s Usb module

Hello everyone , i am working on a project with ch376s usb module using arduino. In this project i am displaying the content of flashDrive on the lcd16x4.
I want to sort files according to their extensions such as, .DOC,.TXT,.JPG.
For example all .DOC extension files will be in one folders and same for others.

I couldn't find a way how to do this ,can anyone help?

Welcome. You might get more help if you were to edit the title to something like "sorting and moving files on SD card".

Which Arduino are you using?
Which SD library are you using?

Does your SD library support moving files? If not, then you might have to try and copy files around. That may be an issue on Arduino with limited RAM.