Merge Command [ME]
Merges an external file into the current workfile by line number. Use Merge to apply source-code "changes-files" containing new and revised text, that are distributed by some application vendors.
MERGE filename [ (rangelist) ]
(Q=no display, J=Justified)
(Default: rangelist: ALL)
MergeQ suppresses printing of the merged lines.
The optional rangelist specifies a subset of the external file to merge into the current file.
Examples
/text master.src {start with the master file}
/merge changes {update changed lines, add new}
Notes
To make your own "merge file", create a file that contains edits to be applied to your current workfile. Mark the lines of text that will replace existing lines in your workfile, with the corresponding line numbers. Give new line numbers to any completely new lines of text to be added to your workfile. $Edit Void removes the line number specified in the command and, optionally, lines up to and including a Void= line number. Warning: the Void= parameter cannot accept a decimal point so, for example, you must enter Qedit line 60.1 as 60100. To delete from line 55 to 60.1, you would use the following:
$edit void=60100
Justified
The default is to replace existing lines with the corresponding line from the external file. The Justified option appends the corresponding line from the external file. Text is appended immediately after the last non-blank character if Set Work Trailingspaces is disabled. If Trailingspaces is enabled, text is appended immediately after the last significant trailing space. If the resulting merged line is too long for the current length, the merged line is truncated. Let's say the current workfile contains:
abc
def
ghj
and the external file contains:
1111
2222
3333
A MergeJ would result in:
abc1111
def2222
ghj3333
If the maximum length was 5, the resulting file would be:
/mergej myfile
1 11111
Warning: Result line will be too long. Truncating merged text.
2 22222
Warning: Result line will be too long. Truncating merged text.
3 33333
Warning: Result line will be too long. Truncating merged text.
3 lines merged
/l all
1 abc11
2 def22
3 ghj33