Previous Next Chapter

Changing Command, Input, and Output Files

These commands change the files set up when you started EDIT from the Shell. These files are:

Changing the Command File

C <filename>

Reads EDIT commands from a specified file. Delimit the file using a character other than a slash (/) since AmigaDOS uses these characters to separate file names. When all commands in the specified file are executed, the file is closed. You can then enter the commands through the keyboard.

Changing the Input File

FROM <filename>

Reads lines from another source file. EDIT does not close the original source file. Reselect the source file by entering the FROM command without an argument. For example of the FROM command, see page 4-54.

Closing a File

CF <filename>

Closes the destination file that was originally specified with the TO command. You can then open that file for input. CF can also close a new input file that is open. For examples of the CF command, see page 4-54.

Changing the Output File

TO <filename>

Specifies a different file as the destination file. The TO command writes the existing queue of output lines to the new TO file. The new TO file is used until another file is specified. Reselect the original destination file by using the TO command with no argument. The alternate output file remains open, but unused. For examples of the TO command, see page 4-54.

Stop executing the command file

Q

Stops EDIT from executing the current command file specified with the WITH keyword or with the C command. EDIT reverts to any previous command file. Using Q at the outermost level is equivalent to using the W command.

The FROM, CF, and TO commands are used as follows:

Command

Action

M10

Pass lines 1-9 in the original source file to the output queue.

FROM .XYZ.

Select the XYZ file for new input; line 10 of the original source file remains current.

M6

Pass line 10 from the original file, then pass lines 1-5 from the XYZ file to the output queue. Line 6 of XYZ is the new current line.

FROM

Reselect the original source file.

M14

Pass line 6 from XYZ, then lines 11-13 from the original source file to the output queue. Line 14 of the source file is the new current line.

FROM .XYZ.

Reselect file XYZ. Line 14 of the source file is still the current line.

M*

Pass line 14 of the source file and all remaining lines of file XYZ to the output queue. An extra line is added to the end of file XYZ. That line is the new current line.

FROM

Reselect the original source file. The extra line added to file XYZ is still the current line.

CF .XYZ.

Close file XYZ.

M*

Pass the remaining lines of the source file (lines 15 to the end of the file) to the output queue.

M11

Pass lines 1-10 of the source file to the original destination file.

TO .XYZ.

Make XYZ the new output file.

M21

Pass lines 11-20 to file XYZ.

TO M31

Make the original destination file current, and pass lines 21 to 30 to it.

TO .XYZ.

Make XYZ the current output file.

M41

Pass lines 31 to 40 to XYZ.

TO

Make the original destination file current.

TO .XYZ.

Send the output queue to file XYZ.

1000N

Advance through the next 1000 lines of the source file.

TO

Select the original destination file.

CF .XYZ.

Close the XYZ file.

|2000 .XYZ.

Insert the 1000 lines from the source file that were sent to file XYZ back into the source file above line 2000.

Top Previous Next Chapter