Makinero:
--------------------------------------------------------------------------------
Is it possible to compare the PSPad in a similar way as in Python? if so, how?

a1=set(open('file1.txt','rb').readlines())
a2=set(open('file2.txt','rb').readlines())
result=list(a2-a1)
open('file3.txt','wb').writelines(result)
--------------------------------------------------------------------------------

Hi,
while I probably wouldn't compare text files like this, but e.g. if you have
files with wordlists or similar, it might be ok.
If I understand correctly, you just make a set difference between the lines of
two files while omitting duplicates and disregarding ordering.

You can achieve similar effect in PSPad in multiple steps:
Make the copies of the input files in PSPad text windows
Use Edit: Sort with the option "[x] Remove duplicates" checked - on both texts
(you will get sorted lines with the duplicates removed - converting to set() in
python you get an arbitrary ordering.)
- alternatively, in PSPad another function can be used too: "Edit: Lines
manipulation: Remove duplicate lines"
which preserves the original order of the lines.

After that the diff functionality in PSPad can be used:
Focus the "source text" intended as the base for the comparison 
Call the context menu with right mouse button over the tab-label of the "target
text" and choose "Text diff with active tab";

in the resulting diff window, you can see the differences marked, under the
rightmost tool icon, there are options to output either the missing lines or
both texts in parallel into a new text tab.
(Of course, the diffing behaviour might not be completely equivalent to your
python code which might or might not matter for your usage.)

In context of your follow-up post I see now, the results would be different, as
some lines are considered as modifications of the original text instead of
additions or removals.

hth,
   vbr

-- 
<http://forum.pspad.com/read.php?2,62736,62784>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem