PDA

View Full Version : Simple File Compare Script in version 2.2.7


John_I
09-May-2005, 01:24 PM
Using v2.2.7 I have the following script that appears to work (compares the correct files) but the resultant report is not what I expected (nothing like the gui and appears to only list the file contents). Any thoughts? Thanks.

load c:\temp\PreviousFile c:\temp\CurrentFile
log verbose "C:\temp\BeyondCompareLog.txt"
expand All
select all.files
compare binary
file-report layout:side-by-side options:display-mismatches output-to:c:\temp\BeyondCompareResults.txt

The log contains:
05/09/2005 03:11:21 PM >> log verbose "C:\temp\BeyondCompareLog.txt"
05/09/2005 03:11:21 PM >> expand All
05/09/2005 03:11:21 PM >> select all.files
05/09/2005 03:11:21 PM >> compare binary
05/09/2005 03:11:21 PM Binary Comparison of <c:\TEMP\PreviousFile\File2.txt> to <c:\TEMP\CurrentFile\File1.txt>
05/09/2005 03:11:21 PM Elapsed time: 0.00 seconds
05/09/2005 03:11:21 PM >> file-report layout:side-by-side options:display-mismatches output-to:c:\temp\BeyondCompareResults.txt
05/09/2005 03:11:21 PM Script completed in 0.06 seconds

The contents of the report (c:\temp\BeyondCompareResults.txt):
FILE COMPARISON
Produced: 05/09/2005 03:11:21 PM

Mode: Just Differences
Left base folder: c:\TEMP\ToptechVersionAudit\PreviousTopTechAuditFi le
Right base folder: c:\TEMP\ToptechVersionAudit\CurrentTopTechAuditFil e

File: File1.txt
-+ 1
2
3
4
5
6
7
8
9
0
a
b
c
d
-------

File: File2.txt
1 +-
2
3
4*
5
6
7*
8
9
0
a
h
d
i
-------

Chris
09-May-2005, 01:29 PM
Are you looking for a list of the names of different files instead of their contents? In that case you'll want the Folder-Report command instead.

09-May-2005, 01:37 PM
No, I want the differences found, by line, of the files contents

Chris
09-May-2005, 02:03 PM
You don't need the compare binary command because a file-report does a rules based comparison (no compare command required), but otherwise your script looks correct.

What type of output were you expecting?

Craig
09-May-2005, 02:11 PM
One thing to add to Chris's reply: The file-report command does a full comparison of each file, rather than the fast binary or rules-based comparison. You can use the binary comparison to decrease the script's total execution time, but to do so you'd need to add a second "select" command after the "compare binary" line that only selects newer, older, different, and orphan files.

John_I
10-May-2005, 06:02 AM
I was expecting a side by side report showing only the differences between the files, as the gui would provide.

Chris
10-May-2005, 09:08 AM
The problems might have something to do with your BC settings. Please email a copy of your script, a few of the files you were comparing, and a .zip of your BC settings to support@scootersoftware.com and I'll look into it further.

To export your BC settings, select Help|Support and click the Export button.