MAINSAIL Utilities User's Guide, Chapter 28

previous   next   top   contents   index   framed top   this page unframed


28. PMERGE, Page Merger

The page merger MODULE, PMERGE, forms an output text file from selected pages of existing input text files. PMERGE prompts for the name of the output file to be created. A ? typed in response to this prompt causes a brief introduction to be displayed.

Once the output file has been specified, PMERGE prompts for input files and the pages to be included from each. To exit PMERGE, type <eol> in response to the Next input file prompt.

After an input file has been specified, PMERGE prompts for the pages to be included from that file. The Pages prompt expects either a line of page specifications, an <eol> or ?. If <eol> is entered, PMERGE prompts for the next input file. Table 28–1 lists the available page specification forms and is displayed when ? is typed in response to the Pages prompt.

Table 28–1. PMERGE Page Specifications
Page Specification Description
m copy page m
m-n copy page m through page n
* copy the whole file
m-* copy page m to the end of the file
-pageSpec copy pages in pageSpec only if not already copied

Any number of page specifications may be entered on a line, separated by commas (no spaces). The first page in a file is page 1. Example 28–2 gives an example of a page specification line.

Example 28–2. PMERGE Page Specification Example
If a file is 13 pages long and the following page specification is given:

9-10,5,7,9,11,-5-11,-*

pages are copied from the input file as follows:

9,10,5,7,9,11,6,8,1,2,3,4,12,13

Example 28–3 shows a sample session with PMERGE. Pages from file1 and file2 are written to outFile. PMERGE displays the pages that it includes after each page specification line.

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

*
pmerge<eol>
Output file (? for help): outFile<eol>

Next input file (eol to stop): file1<eol>

Pages (eol to stop,? for help): 3-5,8,2,-4-10<eol>
 3 4 5 8 2 6 7 9 10
Pages (eol to stop,? for help): <eol>

Next input file (eol to stop): file2<eol>

Pages (eol to stop,? for help): 1,3<eol>
 1 3
Pages (eol to stop,? for help): <eol>

Next input file (eol to stop): <eol>


previous   next   top   contents   index   framed top   this page unframed

MAINSAIL Utilities User's Guide, Chapter 28