MAINSAIL Utilities User's Guide, Chapter 20

previous   next   top   contents   index   framed top   this page unframed


20. LINCOM, Text File Comparer

Command line syntax: lincom {fileName1 {fileName2}}*

LINCOM compares two text files and displays the differences between the files on a per-line basis.

LINCOM accepts file names on the command line or prompts for the names of the two text files to be compared. If command line arguments are given, specify a comma after the second element of a pair to enter subcommand mode. If an odd number of file names are given on the command line, LINCOM prompts for the last fileName2. If no files are specified on the command line, LINCOM prompts with Subcommands? (Yes or eol). If you type Y (or y) in response to this prompt, LINCOM allows you to set various options that control the comparison of the input files. The prompts displayed when the options are set are shown in Example 20–1.

Example 20–1. LINCOM Subcommand Prompts
Name of output file for differences (eol for logFile):
Automatic continuation? (Yes or eol):
Max display lines (eol for 23):
Lines to look ahead (eol for 1000):
Nonblank lines to match (eol for 8):
Treat all blanks as significant? (Yes or eol):
Start at beginning of files? (eol or No):

The differences between the two files are written to an output file. The default output file is logFile.

The default for Automatic continuation? is No. In this case, LINCOM prompts with Continue? (eol or No) after each difference it finds in the input files. If Yes is answered to the Automatic continuation? prompt, LINCOM lists all differences in the input files without prompting.

Max display lines is the largest number of lines displayed at a single difference. If the difference is longer than the specified number of lines, LINCOM prompts with There's more of this difference...want to see it? (eol or No). If you respond with No, the remainder of the difference is skipped; otherwise, LINCOM displays the two different versions of the text.

Lines to look ahead is the maximum number of lines scanned in order to resynchronize the input files when a difference is found. The default is 1000. If LINCOM cannot resynchronize after finding a difference (i.e., the number of lines that differ exceeds the lookahead value), LINCOM prints the message Lookahead insufficient to synchronize and continues. If anything other than No is typed in response to the Continue? (eol or No) prompt, LINCOM doubles the lookahead value and continues. In this case, a message indicating that the lookahead value has been doubled is displayed.

Nonblank lines to match is the number of nonblank lines that have to match before LINCOM considers the input files synchronized after finding a difference. The default is 8. Any blank lines between the matching nonblank lines must also match in order for LINCOM to consider the input files to be resynchronized.

The default for Treat all blanks as significant? is No. In this case, LINCOM ignores leading and trailing blanks and tabs when comparing lines, and treats other sequences of blanks and tabs as a single blank. If Yes is answered to the Treat all blanks as significant? prompt, two lines being compared must be exactly the same in order for LINCOM to consider them to match.

The default for Start at beginning of files? is Yes. LINCOM can skip to an arbitrary page and line in each input file before comparing them, thus ignoring any differences that may occur beforehand. LINCOM considers that pages in a file are separated by the page mark (eop) character. If the answer is No, LINCOM prompts for the beginning page and line number of each file in turn. Each file's starting page and line number is specified as pageNumber.lineNumber. Input file 1's default page and line number is 1.1 (the first line); input file 2's default page and line number is whatever was specified for input file 1.

When differences between two files are found, LINCOM prints an identification line for each file, giving the name of the file and the page and line number of the file followed by the text that differs from the other file. After all the differences between two files have been reported, LINCOM prompts with Compare more files? (eol or No).

Example 20–2 shows how to use LINCOM and what its output looks like. Since <eol> was entered in response to the Subcommands prompt, default values are used.

Example 20–2. LINCOM Example
MAINSAIL (R) Version 16.20.<release> (? for help)
Revision: <date>
Copyright (c) 1984-1998 by XIDAK, Inc., Point Arena,
 California, USA.

*
lincom<eol>
Input file 1 (just <eolto stop): file1<eol>
Input file 2: file2<eol>
Subcommands? (Yes or eol): <eol>

-------- 
file1 page 6 line 63 --------
Unresolved global errors from the binder are completely

-------- 
file2 page 6 line 63 --------
Unresolved errors from the binder are completely

Continue? (eol or No): <eol>

-------- 
file1 page 7 line 51 --------
be a multiple of 32.  The amount of buffer space allocated

-------- 
file2 page 7 line 51 --------
be a multiple of 64.  The amount of buffer space allocated

Continue? (eol or No): <eol>

-------- 
file1 page 8 line 20 --------
calls must be made through the Foreign Language
Interface.

-------- 
file2 page 8 line 20 --------
calls must be made through the foreign language
interface.

Continue? (eol or No): <eol>
Input file 1 (just <eolto stop): <eol>
*


previous   next   top   contents   index   framed top   this page unframed

MAINSAIL Utilities User's Guide, Chapter 20