Formulation of the problem. There is a folder with files, you need to sort through the files and check which ones are text.
How to make the check itself? How to check if the text is a file or not?
As a result, all text files will be compared by content.