(edited 14-Jun) (Inserting Text from Auxiliary Input Files\insert_chap)

(Insertingtext from auxiliary input files) (Auxiliary input fileinserting text from) You can specify a closed auxiliary output file or any other text file as an auxiliary input file and then insert all or part of its contents in the file you are editing.

You can use an auxiliary input file and an auxiliary output file at the same time, combining text from the auxiliary input file with your input file and copying parts of the file you are editing to an auxiliary output file. You can use only one auxiliary input file and one auxiliary output file at a time, but by changing them during an editing session, you can combine and split several files in many ways.

(copy_chap) tells you how to create an auxiliary output file. This chapter tells you how to: (UNNUMBERED) Open an auxiliary input file ((openinput_sec)) Skip to the line or page in the auxiliary file where you want to begin selecting the section to be inserted ((skip_sec)) Insert all or part of the text from the auxiliary file into the file you are editing ((insert_sec)) Close the auxiliary file ((closeinput_sec)) (Opening an Input File\openinput_SEC)

(Openingauxiliary input file) (Auxiliary input fileopening) You can open a closed auxiliary output file ((copy_chap)) or any other text file as an auxiliary input file while you are creating or editing a file. You cannot open an auxiliary input file while you are inspecting a file.

To open an auxiliary input file: (OPEN INPUT filespec command) (CommandsOPEN INPUT filespec) (NUMBERED) Press (GOLD) and (COMMAND). Type: ([OPEN] INPUT filespec)

(filespec) is the file specification of an existing text file. Press (ENTER)

KED opens the file you specified.

In other words: (simple) ((GOLD) (COMMAND) INPUT filespec (ENTER))

(ps\mlo-003506.ps\33)

You can use only one auxiliary input file at a time. If you issue an OPEN INPUT command to open a second auxiliary file without closing the first input file, KED closes the first file and then opens the second auxiliary input file. The first file is closed even when the OPEN INPUT operation for a second file is aborted; when, for example, you learn that the specified file does not exist and you decide to stop the operation. (Skipping Text in the File\SKIP_SEC)

(Skipping text in auxiliary input file) (Auxiliary input fileskipping text) By default, KED starts at the beginning of your auxiliary input file. If the text you want to insert is somewhere else, you can use the SKIP number LINES or SKIP number PAGES command to specify another starting point in that file.

KED can skip lines and pages in one direction only---forward. (unnumbered) If you skip past the point where you want to begin selecting text, you can close the input file as described in (closeinput_sec), and then reopen it as described in (openinput_sec). If you skip to the end of the input file, KED closes it.

If you try to skip again, KED signals you by sounding a beeper or reversing the text and background on your terminal. If you press (HELP), KED displays: Auxiliary input file not open (SKIP number LINES Command)

(SKIP number LINES command) (CommandsSKIP number LINES) To skip one or more text lines in the input file: (NUMBERED) Press (GOLD) and (COMMAND). Type: (SKIP number [LINES])

(number) can be from 1 to 32767. You do not have to type (LINES). If you type it, do not type the square brackets. Press (ENTER).

Beginning at its current location in the input file, KED skips the number of lines you specified.

Type: (simple) ((GOLD) (COMMAND) SKIP number [LINES] (ENTER))

For example, to advance five lines: (simple) ((GOLD) (COMMAND) SKIP 5 LINES (ENTER)) (SKIP number PAGES Command)

(SKIP number PAGES command) (CommandsSKIP number PAGES) To skip one or more pages in the input file: (NUMBERED) Press (GOLD) and (COMMAND). Type: (SKIP number PAGES)

(number) can be from 1 to 32767. You must type (PAGES). Press (ENTER).

Beginning at its current location in the input file, KED skips the number of pages you specified.

In other words: (simple) ((GOLD) (COMMAND) SKIP number PAGES (ENTER))

For example, to advance five pages: (simple) ((GOLD) (COMMAND) SKIP 5 PAGES (ENTER))

In skipping pages, KED uses its default definition of a page (all the text between form-feed characters) or the definition you created with the SET ENTITY PAGE command. Be sure that the current page definition matches the way pages are marked in the input file. (Inserting Text from the File\INSERT_SEC)

(Insertingtext from auxiliary input file) (Auxiliary input fileinserting text from) The text you insert from an open auxiliary input file remains unchanged in that file.

To insert text from an auxiliary input file: (NUMBERED) If necessary, enter a SKIP command as described in (skip_sec), to specify the point in the input file where you want to begin selecting text. As shown below, enter an INCLUDE REST, INCLUDE number LINES, or INCLUDE number PAGES command to specify the number of lines or pages of text in the input file that you want to insert. (INCLUDE REST Command)

(INCLUDE REST command) (CommandsINCLUDE REST) To insert all the text in the input file, starting at the point where the cursor is located: (NUMBERED) Press (GOLD) and (COMMAND). Type: (INCLUDE REST) Press (ENTER).

KED inserts all the text at the point where the cursor is located, moves the cursor to the end of the insertion, and closes the input file.

In other words: (simple) ((GOLD) (COMMAND) INCLUDE REST (ENTER)) (INCLUDE number LINES Command)

(INCLUDE number LINES command) (CommandsINCLUDE number LINES) To insert one or more lines of text from the input file, starting at the point where KED is located: (NUMBERED) Press (GOLD) and (COMMAND). Type: (INCLUDE number [LINES])

(number) can be from 1 to 32767. You do not have to type (LINES). If you type it, do not type the square brackets. Press (ENTER).

KED inserts the selected text at the point where the cursor is located.

In other words: (simple) ((GOLD) (COMMAND) INCLUDE number [LINES] (ENTER)) (INCLUDE number PAGES Command)

(INCLUDE number PAGES command) (CommandsINCLUDE number PAGES) To insert one or more pages of text from the input file, starting at the point where KED is located: (NUMBERED) Press (GOLD) and (COMMAND). Type: (INCLUDE number PAGES)

(number) can be from 1 to 32767. You must type (PAGES). Press (ENTER).

KED inserts the selected text at the point where the cursor is located.

In other words: (simple) ((GOLD) (COMMAND) INCLUDE number PAGES (ENTER))

In selecting pages, KED uses its default definition of a page (all the text between form-feed characters) or the definition you created with the SET ENTITY PAGE command. Be sure that the current page definition matches the way pages are marked in the input file. (Closing the File\closeinput_SEC)

(Closing auxiliary input file) (Auxiliary input fileclosing) KED closes the auxiliary input file when you end your work session. If you open a second input file while one is open, KED closes the first and opens the second input file.

In some situations you may want to close the input file. For example, if you skip beyond the point where you want to begin selecting text: (SKIP REST command) (CommandsSKIP REST) (NUMBERED) Press (GOLD) and (COMMAND). Type: (SKIP REST) Press (ENTER).

KED moves from its current location to the end of your input file and then closes it.

In other words: (simple) ((GOLD) (COMMAND) SKIP REST (ENTER)) (Examples)

This section summarizes most of the information in this chapter by providing examples of the steps necessary for copying text from an auxiliary input file to a file you are creating or editing.

Each step has two parts. (numbered) An instruction to complete The keys you must type to complete the instruction

The keys you must type are presented in a horizontal line, and the strings of letters and numbers you must type are not enclosed by boxes.

This section provides examples of: (simple) Inserting text from an auxiliary input file Using auxiliary output and input files to move a large section of text (Inserting Text from an Auxiliary Input File)

In the example at the end of (copy_chap), you created auxiliary output file AUXOUT.TXT. In the following procedure, you will use that file as an auxiliary input file and insert its contents in file WEEK2.TXT. (numbered) Begin your work session to create or edit WEEK2.TXT. (EDIT WEEK2.TXT/CREATE (RET))

or (EDIT WEEK2.TXT (RET)) Use the OPEN INPUT filespec command to open AUXOUT.TXT as an input file. (GOLD) (COMMAND) OPEN INPUT AUXOUT.TXT (RET) Use the INCLUDE REST command to copy the contents of AUXOUT.TXT to the top of WEEK2.TXT and to close AUXOUT.TXT. INCLUDE REST (RET) End your work session with the EXIT command. EXIT (ENTER) (Using Auxiliary Output and Input Files to Move a Large Section of Text)

The KED paste buffer is usually large enough to let you move text around within your files. You may, however, want to move larger amounts of text than the paste buffer can hold. In that case, the general procedure for using auxiliary output and input files to move a large section of text is as follows. (numbered) Open an auxiliary (output) file. Copy the section of text from your file to the auxiliary file, and close the auxiliary file. Delete the section of text from your file. Move the cursor to where you want the section of text to reappear in your file. Open the auxiliary (input) file and copy the section of text from the auxiliary file to your file.

The following specific procedure for a particular file describes one method you can use. This example assumes that: (unnumbered) Page numbers in your file appear at the bottom of each page and are enclosed by hyphens (for example, -7-). The pages are separated by the marker NEXTPAGE. The section you want to move includes all of pages 8, 9, and 10. You want to move those pages 150 lines backward in your file. (numbered) Open auxiliary output file AUX.TXT. (GOLD) (COMMAND) OPEN OUTPUT AUX.TXT (RET) Define a page in terms of the marker that separates your pages. SET PAGE "NEXTPAGE" (ENTER) Move the cursor to the beginning of the section of text you want to move. (alphabetic) Search forward for the string -7-. (GOLD) (FIND) -7- (ADVANCE) Move to the beginning of page 8. (PAGE) Copy pages 8, 9, and 10 to the auxiliary output file. (GOLD) (COMMAND) WRITE 3 PAGES (RET) Close the auxiliary output file. CLOSE (RET) Delete the section of text you copied to the auxiliary output file. (alphabetic) Clear the paste buffer. CLEAR PASTE (ENTER) Select the 3-page section of text to be deleted. (SELECT) (BACKUP) (PAGE) (PAGE) (PAGE) Delete that section of text. (GOLD) (REPLACE) Move the cursor to where you want the section of text to reappear. (BACKUP) (GOLD) 150 (BLINE) Open the auxiliary output file as an input file. (GOLD) (COMMAND) OPEN INPUT AUX.TXT (RET) Copy the contents of the auxiliary file to your file. INCLUDE REST (ENTER)