Comparing two files.

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Pete S.

Comparing two files.

Post by Pete S. »

I have two files:

source.txt (portion of the source.txt file below)

START: Scanning VOL1:, #1
FILE: ARC$NEXT.NXT
SIZE:200, read:200
FILE: VOL$LOG.ERR
SIZE:8000, read:8000

DIR: VOL1:\DELETED.SAV
FILE: PC36.DAT
SIZE:1327, read:1327
FILE: PCS36.DAT
SIZE:1327, read:1327
FILE: PAYSUIT.PIF
SIZE:967, read:967
FILE: PAYSUITE.ICO
SIZE:3774, read:3774
FILE: GO.BAT
SIZE:0, read:0

and

destination.txt (portion of the destination.txt file below)

START: Scanning VOL1:, #1
FILE: VOL$LOG.ERR
SIZE:8000, read:8000
FILE: ARC$NEXT.NXT
SIZE:200, read:200

DIR: VOL1:\DELETED.SAV
FILE: PC36.DAT
SIZE:1327, read:1327
FILE: PCS36.DAT
SIZE:1327, read:1327
FILE: PAYSUIT.PIF
SIZE:967, read:967
FILE: PAYSUITE.ICO
SIZE:3774, read:3774
FILE: GO.BAT
SIZE:0, read:0

I know that destination.txt file has 32 files (out of 120,000+files) less than all the files listed in source.txt. I am trying to determine how to figure out which files are in source.txt but are not in destination.txt. I have tried running "Tools" -> "Compare Files" but I am not getting desired results. If I understand what the output "Compare Files" is giving me to begin with, it seems that the compare is done line by line and I guess what I would like is to compare the contents of these two files without regard to the order in which the records (in this case filenames) are listed in the source.txt and destination.txt files. I was trying to figure out how to build a regular expression to remove everything but the filenames from both source.txt and destination.txt files, then sort the content of both files alphabetically and then do a line by line comparison from within Textpad but unfortunately I am still not getting a desired result. I could not figure out the regular expression so I just created some sample data with filenames only, already sorted alphabetically, and even then Textpad's "Compare Files" feature is not giving me what I would really like:

Compare this:

This is line 1.
This is line 2.
This is line 3.
This is line 4.
This is line 7.

to this:

This is line 1.
This is line 2.
This is line 3.
This is line 5.
This is line 6.

"Compare Files" output

4,6c4,5
< This is line 4.
< This is line 7.
<
---
> This is line 5.
> This is line 6.

Maybe I should try a different approach all together -- any suggestion are greatly appreciated.

Thank you.

Pete
P.S. Hopefully the explanation makes sense :-)
Andreas

RE: Comparing two files.

Post by Andreas »

Although I do not completly understand what you don't like about the output of compare files may I suggest you try ExamDiff Pro which is (IMO) the best program to compare files (you can get it from http://www.nisnevich.com/examdiff/examdiffpro.htm)

Andreas
Post Reply