Dec 212017
 
Compare 2 text files, write diffs to newfile.
File TDCOMP40.ZIP from The Programmer’s Corner in
Category Word Processors
Compare 2 text files, write diffs to newfile.
File Name File Size Zip Size Zip Type
TDCOMPAR.COM 21791 14094 deflated
TDCOMPAR.DOC 7787 2877 deflated

Download File TDCOMP40.ZIP Here

Contents of the TDCOMPAR.DOC file



Saxman Software
Tools Disk Series



Program: TDCOMPARE
Version: 4.0 11/01/87
Purpose: Compare two text files
Syntax: TDCOMPARE filespec1 filespec2 [ options ... ]
Author: Jim Standley, Saxman Software
Language: TURBO Pascal


Overview

TDCOMPARE may be used to compare two text files. These are
files which use carriage return and line feed at the end of
each line. The most common use will probably be by
programmers to compare versions of source code.

The first file is called "File A", the second is "File B".
The program reports lines which match, lines which occur in
File A only, and lines in File B only.

When a no-match is found, TDCOMPARE attempts to get the files
back in step. If there are more than 120 unique lines in one
spot TDCOMPARE won`t get back in synch.

Blank lines may cause the program to think the files are back
in synch when they are not. Version 4.0 has some new code
which improves blank line handling, but the problem still may
arise.

Press any key while TDCOMPARE is running to terminate the
program.


Syntax:

TDCOMPAR filespec1 filespec2 [ options ... ]

Filespec1 and Filespec2 name the two files to be compared.
TDCOMPARE searches the current directory, then each directory
in the path for the files, just the way DOS searches for
programs. If you specify drive or directory names, this path
searching is not done. Globals and wildcards are not
allowed.


Options

Options may be given after the two filespecs. They may be
abbreviated to the shortest unique truncation, which is in
caplital letters. If you really like the way UNIX and DOS do
options, you can use slashes with the keywords. Here are the
choices:

Match - Display matching lines
NOMatch - Suppress matching lines. Default.
Width nn - Truncation width of output in characters
Print - Send output to printer
Tofile filespec - Send output to a disk file
Verify - Display counts for identical files
NOVerify - Suppress output on identical files
FRomcol - Leftmost column to compare
FOrcol - Number of columns to compare

By default, the program prints a count of matching lines, but
not the matching lines. The default width is 80, and the
default output is to the screen.

TOFILE can be directed to any Turbo Pascal standard device.
For example, TOFILE PRN is exactly like PRINT and TOFILE CON
is exactly like the default.

The NOVERIFY option suppresses all file information output,
leaving only the identification displays. This was intended
for use with the PRINT option. If the files are identical,
nothing is printed at all.

FROMCOL and FORCOL may be used to compare one part of each
line while ignoring the rest. For example, COBOL programmers
might want to ignore statement sequence numbers. The
defaults are FROMCOL 1 FORCOL 255. If you display matching
lines, you will see lines from FILE A and you will not know
if there were non-matching characters in FILE B outside the
columns tested.


Examples:

TDCOMPARE TDCOMPAR.PAS TDCOMPAR.BAK
TDCOMPARE TDCOMPAR.PAS TDCOMPAR.BAK TO TEMP
TDCOMPARE TDCOMPAR.PAS TDCOMPAR.BAK P M W 132
TDCOMPARE TDCOMPAR.PAS TDCOMPAR.BAK ( P M W 132
TDCOMPARE TDCOMPAR.PAS TDCOMPAR.BAK /P/M/W 132

When using slashes you don't need to separate the options
with spaces. You must have a space before the number of
characters for WIDTH or the filename for TOFILE. If you get
in the habit of using an open paren before the options (with
VM/CMS or other Saxman Software utilities) this program will
ignore it.


Error Level

The DOS error level is set to help you control batch files.
Here are the possible values:

0 = Files equal
1 = Files not equal
2 = Input file A not found
3 = Input file B not found
4 = Invalid options

If TDCOMPAR is terminated in mid-run, the error level will be
0 or 1 depending on whether or not it found any mismatches
before it was stopped.


Availability

The latest versions of all Saxman Software utilities are
available on the Information Booth bulletin board. The BBS
is also a good way to contact the author.

The phone number is 316-684-8744. The Information Booth
supports baud rates from 1200-19200, 24 hours a day.

The Information Booth usually requires you to register and
wait overnight for registration to be accepted before you can
download files. As a special service, certain files can be
downloaded without registration. Saxman Software programs
are among them.

You might want to download TDTOOLS.ARC. This contains a text
file listing current versions of all the utility programs.


Distribution:

This program, in source and object form, is protected by
copyright law, and is NOT in the public domain. It is,
however, "user-distributed". It may be distributed freely in
any manner, with the following restrictions:

1 - Do not charge for distribution of this program, beyond
the cost of reproduction & mailing.
2 - Distribute this documentation with the program.
3 - Leave the author's name & address in the document.
4 - Do not distribute modified versions.

It is the author's desire that no other party make a profit
from distribution of this program. I specifically deny
permission to use this program to companies like PC-Sig or
bulletin boards which charge for download privileges.

If you want to promote user-distributed software and feel the
program is useful enough to be worth $15.00, the contribution
will certainly be appreciated. It will also get you on a
mailing list for future versions and other utilities.
Include a diskette and self-addressed mailer if you'd like
the source code. Source code may not be distributed by you.


Author:

Jim Standley
Saxman Software
2350 Winstead Circle
Wichita, Ks 67226
316-688-0235 18:00-22:00 CST


Revision Log

Prior versions of this program with full-screen entry of
filespecs and options were distributed with DMS/PC, a screen
handling package for Turbo Pascal. The comparison routines
in this version are unchanged, except that trailing blanks
are removed from the input data. The command syntax is new
with version 3.0.

4.0 11/01/87 - Added blank line checking, FROMCOL and FORCOL.


 December 21, 2017  Add comments

Leave a Reply