I have two files (f1 and f2) containing some text (or binary data).
How can I quickly find common blocks?
e.g.
f1: ABC DEF
f2: XXABC XEF
output:
common blocks:
length 4: ‘ABC ‘ in f1@0 and f2@2 length 2: ‘EF’ in f1@5 and f2@8
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Wikipedia has some pseudocode for finding the longest common substring between two sequences of data. In your case, you simply extract all common substring from the table that are not prefixes of other common substrings (i.e. maximal common substrings).