file name pattern matching and identifying
This does not sound like a machine learning problem. It seems to me that you could come up with a list of rules that determine whether two files belong together.

As S van Balen said, you should take a look at the glob and re packages in Python. (If you are on Linux, a Bash script would probably be much more elegant than a solution in Python).

The following links might be helpful:


Walk through a directory and its subdirectories to get a list of all files: https://stackoverflow.com/a/954522/4743630.
Group strings in a list based on partial matches (for instance: turn ['file_name1_xyz', 'file_name2_xyz', 'file_name1_abc', 'file_name2_def'] into [ ['file_name1_xyz', 'file_name1_abc'], ['file_name2_xyz', 'file_name2_def'] ]): https://stackoverflow.com/questions/40167651/python-iterate-through-a-list-of-strings-and-group-partial-matching-strings.


You mention that files may have different file types. Be careful when converting between types: Make sure for instance that separators and quote characters are treated correctly.