I'm trying to find a solution for the following problem. I have two sets of files:
- Folder A has around 400 text files.
- Folder B has around 20 000 text files total in several subfolders.
Files in folder A are either modified versions of files in folder B or they are parts of files in folder B. When I say "parts", I mean that a file in folder A might contain part of the text of a file in folder B, but not everything.
I want to match those pairs i.e. for each file in folder A I want to find the file or files in folder B that most closely resemble the file in folder A.
For example I would like to have the following kind of report:
File ./A/foo123.txt most closely matches file ./B/bar243.txt with 68% of lines identical. File ./A/bar306.txt most closely matches file ./B/foo85.txt with 30% of lines identical.
Is there a command line tool that I could use to achieve this result? Or what would be the best way to do this?