Question

I have two notepads and each notepad contains some data. Let's say Notepad 1 and Notepad 2

Notepad 1 contains: A, B, C

Notepad 2 contains: C, D, E

I want to ask that how can i find data in Notepad 2 that contains notepad 1 data. Here answer is C. But i have lots of data in notepad 1 and notepad2. It is not possible to take individual data from notepad 1 and to press Ctrl+F in notepad 2 to find data. Is there any suitable method for this? Will it be possible by converting these notepads into html pages?

Was it helpful?

Solution

Probably you'd like to have a look on diff/merge tools. WinMerge is a free one. Another good option is Araxis Merge, it is commercial. Also you can just use Notepad++ editor with its Compare plugin. These tools are GUI based and can help you if you want to see and edit difference.

If you need to extract and somehow automatically process difference, you more likely will have to use some console tools and scripting. *nix diff command can be used to extract difference and there are a lot of scripting languages suitable for text processing: sed, AWK, Perl, Python for instance.

OTHER TIPS

This can be done with the comm(1) tool:

$ cat F1
A
B
C
$ cat F2
C
D
E
$ comm -12 F1 F2
C
$ 

The -1 suppresses all lines unique to the first file. -2 suppresses all lines unique to the second file. All that is left is lines common to both.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top