want to compare two text file. Suppose file AA contains following text
1.The onunload event occurs once a
2.page has unloaded (or the browser window has been closed).
3.onunload occurs when the user
4.navigates away from the page (by clicking on a link, submitting
5.text One
6.text two
7.text three
And file BB contains following text
1.The onunload event occurs once a
2.page has unloadd (or the browser window has been closed).
3.onunload the when occurs user
4.navigates away from the page (by clicking on a link, submitting
5.text two
6.text One
7.text three
What I want is
-Line 1 in AA and 1 in BB is exact match
-Line 2 in AA and 2 in BB is match but contains error (see word "unloadd" in BB content)
-Line 3 in AA and 3 in BB is match but words are swaped in BB content
-Line 4 in AA and 4 in BB is exact match
-Line 5 in AA is swapped to Line 6 in BB .
-Line 6 in AA is swapped to Line 5 in BB.
-Line 7 is exact match with line 7 in BB.
How to achieve this ? Is there any pattern matching algorithm?