KEDIT Hints and Tips: The GET and PUT Commands

It is often useful to insert all or part of some file on disk into a file that you are editing. And it is often useful to write all or part of a file that you are editing into another file on disk. To handle these needs, KEDIT provides the GET and PUT commands:

Getting text from a disk file

Suppose you want to add some text to the file you are editing and the text is in another file named C:\TABLE.TXT that you are not currently editing. You can pull in text from that file with the GET command.

For example, if enter this GET command on KEDIT's command line:

get c:\table.txt

here is what will happen:

All of the lines of the file C:\TABLE.TXT will be retrieved from the disk copy of the file and inserted into the file you are editing at the current line. In KEDIT for Windows, the current line is indicated by a dashed box. Note that the dashed box only appears when the cursor is on the command line.

By default, the current line is in the middle of your screen. You can make a line of your file become the current line by scrolling the screen up or down or by placing the cursor on the line and pressing the F5 key.

You can also use the GET command to retrieve part of a file, instead of the entire file. To do this, you specify two additional operands: the line number of the first line in the disk file that you want to insert, and the total number of lines that you want to insert.

For example, if you use the command:

get c:\table.txt 2 3

the GET command begins with line 2 or the disk file and inserts 3 lines, so that lines 2, 3, and 4 of c:\table.txt are inserted:

Putting text to a disk file

Suppose you want to write some text from the file you are currently editing to a file on your disk that you are not editing. You can do that with the PUT command.

For example, if you enter this PUT command:

put all c:\duplicate.txt

here is what will happen:

All of the lines of the file you are editing, C:\SATEL.TXT, will be put to a file on your disk called C:\DUPLICATE.TXT. If DUPLICATE.TXT already exists on your disk, the lines will be added to the bottom of the file. If DUPLICATE.TXT does not already exist, KEDIT will create it. (If you want to be sure that the PUT command writes a new file, and does not append to an existing file, you can use an ERASE command, such as ERASE C:\DUPLICATE.TXT, before using the PUT command.

In the previous example, ALL specified that all lines of the file you were editing would be written to disk by the PUT command. You can also write just a part of a file to disk. For example, if you enter the PUT command:

put 5 c:\paragraph.txt

here is what will happen:

Five lines of the file you are currently editing, starting at the current line, are put into the disk file, C:\PARAGRAPH.TXT.

If PARAGRAPH.TXT already exists on your disk, the lines will be added to the bottom of the file. If PARAGRAPH.TXT does not already exist, KEDIT will create it.


KEDIT Home Page
KEDIT Overview | Download Libraries | Maintenance Releases
Ordering/Licensing | Demo Version | Technical Support | What's New
KEDIT for Windows 1.6.1 Upgrade | KEDIT Mailing List

Copyright © 1996-2012 Mansfield Software Group, Inc.