Can I output a simple text file of lines which are different

General questions about using ExamDiff Pro, ideas for new features, bug reports, and usage tips.
kevinshowell
New Member
Posts: 2
Joined: Tue Jun 15, 2004 3:22 pm

Can I output a simple text file of lines which are different

Post by kevinshowell »

I am comparing two files and would like to produce an output file that is a simple text file containing the lines from file 1 which are different from file2.

Is this possible?
Is it possible to do this for all files in two directories which contain identically named files.?
Ideally I would like to be able to do this from a command line with no further interaction being required.

Is any of the above possible?
Kevin S. Howell
User avatar
psguru
Site Admin
Posts: 2232
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post by psguru »

Yes, it is possible. Use /o option to produce a diff output for 2 files. Use /f option along with /o option to produce a diff report for 2 directories that also includes file diffs.
psguru
PrestoSoft
kevinshowell
New Member
Posts: 2
Joined: Tue Jun 15, 2004 3:22 pm

Post by kevinshowell »

I must obviously be doing something wrong, or we are talking at cross purposes. If I use just the /o option is does indeed produce a text file, but this is a unix style diff report rather than a file which contains just the lines from file 1.

e.g. the comparision produces
6,7c6,7
< Angel,George Henry D,Plympton,5b,363
< Angel,Maurice,Marylebone,1a,997
---
> Angel,George Henry D,Plympton St M,5b,*63
> Angel,Maurice,Marylebone,1a,**7

but I would like it to produce just
Angel,George Henry D,Plympton,5b,363
Angel,Maurice,Marylebone,1a,997

Is this possible?
Thanks in advance.
Kevin.
Kevin S. Howell
User avatar
psguru
Site Admin
Posts: 2232
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post by psguru »

I thought you meant Unix diff format. No, what you need is not directly possible. You could write, say, a Perl script to process EDPro's output and get what you need.
psguru
PrestoSoft
Farrillaga
New Member
Posts: 1
Joined: Tue Jul 06, 2004 4:36 am

Post by Farrillaga »

I've found a possible solution. I can choose 'Use Filter View' in order to see only the differences. Select all the text of the first pannel, copy the selected text and paste-it on the Notepad. Only the differences are shown. At last, save the notepad content.
User avatar
psguru
Site Admin
Posts: 2232
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post by psguru »

This will work from the GUI. However, the original poster wanted to save such diff-only file from the command line...
psguru
PrestoSoft
CountZero
New Member
Posts: 1
Joined: Tue Jul 13, 2004 4:39 am

Post by CountZero »

If you use such tools like the GNU unix tools for windows from http://unxutils.sourceforge.net/
you may add to your script something like this:

set DIFF_FILE=diff.txt

REM comp (whatever)
examdiff a b /o:%DIFF_FILE%

REM get rid of identical files
grep -v "^Identical files" %DIFF_FILE% > NOT_IDENTICAL_FILES.TXT

by using grep with -v it will copy all lines not beginning with Identical files to the new file: NOT_IDENTICAL_FILES.TXT

Did I understand your question correct?
User avatar
psguru
Site Admin
Posts: 2232
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post by psguru »

Yes, you could do that. Or use View Filter in EDPro to only output non-identical file. The original problem, however, was to related to file, not directory, comparison.
psguru
PrestoSoft
sn00p
New Member
Posts: 3
Joined: Sun Aug 27, 2006 2:51 pm
Location: Texas

Post by sn00p »

Since it has been over 2 years from when this question was asked, I thought I would bring it back up. The only thing I need is a prog that can compare 2 text files and output another text file with just the lines that are different, and do this from the command line so I can script it.

Can the latest version do this?

Regards,

Craig
User avatar
psguru
Site Admin
Posts: 2232
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post by psguru »

No, this is still not possible without additional scripting. To be honest, this feature hasn't been on our priority list since it's not requested by many users.
psguru
PrestoSoft
sn00p
New Member
Posts: 3
Joined: Sun Aug 27, 2006 2:51 pm
Location: Texas

Post by sn00p »

I understand. However, this is the first program that I have found that can actually display just the differences in 2 files. The let down is that it cannot be saved so I have to copy and paste the results into 26 individual files every time I use it.

I'm not much of a programmer so I have no idea what is required to go from display to text file output. I'll keep checking back to see if this ever makes it into the program. Thanks!

- Craig
User avatar
psguru
Site Admin
Posts: 2232
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post by psguru »

Well, perhaps you could provide an example of what you are looking for. It's possible that your particular need has already been covered by the current implementation of ExamDiff Pro.
psguru
PrestoSoft
sn00p
New Member
Posts: 3
Joined: Sun Aug 27, 2006 2:51 pm
Location: Texas

Post by sn00p »

Basically, I have 26 pairs of text files, the old versions and the new versions in seperate directories. They are just rows of data like the following example:

id,eid,empstatus,6,6,Y,N,Y,Y,,,,,

What I want is to be able to compare each pair of files and output only the lines that differ in a 3rd text file. Also, I would like to be able to do this from the command line so that I can run one batch file and process all 26 pairs of files.

Let me know if I have left out any important details.

Thanks!

- Craig
User avatar
psguru
Site Admin
Posts: 2232
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post by psguru »

Have you tried /o option? The result will be something like

1,2d0
< Line 1 from the first file
< Line 2 from the first file
4c2
< Line 4 from the first file
---
> Line 2 from the first file
psguru
PrestoSoft
davidla
New Member
Posts: 4
Joined: Thu Nov 02, 2006 4:10 pm
Location: Cairns

simple output diff text

Post by davidla »

Hi,
I was planning to use your program to compare to two 50MB .csv files (yesterday and todays) which are uploaded to a website via FTP each night. I thought it was about time to only upload the differences. Alas it seems I can output the difference but you apend it with information which I then would have to strip out. I note your comments that no one has asked for this function, but think for a minute, if you provide a visual presentation of the information in your GUI, why would anyone need the information repeated in the diff output file, the very information invalidates it!
You would only need the physical diff file if you wanted to do something with it, wouldn't you? You could prepare a totally separate report with the information you currently put in the diff file, if needed.

If you ever put the (obviously needed) option in to your program to obtain a diff file, please email me and alert me because I will likely buy it; meantime I'll go shopping for one that does.

David
It isn't pretty being easy
Post Reply