[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 INed Editor User's Guide

Chapter 5. Manipulating Text

This chapter explains how to use the INed editor command keys to manipulate text efficiently. For example, you can delete, move, copy, and mark text.

You can delete text in several different ways. You can delete one character at a time, delete complete lines, delete several lines, or delete the remainder of a line.

You can mark text by complete lines, by boxes, or by text lines. You can then pick up the marked text (or a copy) and store it in the pick-up stack buffer, or you can delete it. A stack buffer stores text in sequence. The last text stored is the first text out. You can place (put down) the contents of the pick-up stack buffer in other areas of your text including into other files. You can put down a copy of the text and leave the text in the buffer, or you can put down the text and remove it from the buffer. You can also put down multiple copies of the text.

Note: The pick-up stack buffer only keeps text for the current editing session. When you exit the editor, it deletes all of the stack buffers.

You can select the text you want to replace by using the Ctrl-A, Up Arrow or Ctrl-A, Down Arrow key sequence (the Search Up or Search Down function). You can then use the Replace command key to replace the text.

For information on the procedures, refer to the following:

How to Delete and Restore Text with the INed Editor

You can use the following procedures with INed editor subcommands:

To Delete Characters Right of the Cursor

Text deleted this way cannot be recovered.

  1. Move the cursor to the characters you want to delete, and press the Delete key (the Delete Char function).

    The cursor does not move. The character at the cursor position is deleted, and all characters located to the right of the cursor move left.

    As you hold down the Delete key, the editor continues to delete characters.

  2. When you have deleted all the characters that you want to remove, release the Delete key.

To Delete Characters Left of the Cursor

Text deleted this way cannot be recovered.

  1. Move the cursor to the right of the characters you want to delete, and press the Backspace key (the Backspace function).

    The cursor moves left one space, and the character to the left of the cursor is deleted. In insert mode, the remaining line of text moves left to fill the deleted character's position. In overwrite mode, the deleted character's position is space-filled, and the remaining line of text does not move.

    As you hold down the Backspace key, the editor continues to delete characters.

  2. When you have deleted all the characters that you want to remove, release the Backspace key.

To Delete One or More Lines

  1. Move the cursor to the line that you want to delete, and press the Ctrl-A, Delete key sequence (the Delete Line function).

    As you hold down the Delete key the editor continues to delete lines.

  2. When you have deleted all the lines that you want to remove, release the Delete key.

To restore text deleted this way, see To Restore the Last Deleted Text.

To Delete a Specified Number of Lines

  1. Move the cursor to the first line you want to delete, and press the Ctrl-A, Enter key sequence (the Enter function).

  2. Type the number of lines you want to delete in the ENTER box, and press the Ctrl-A, Delete key sequence (the Delete Line function).

To restore text deleted this way, see To Restore the Last Deleted Text.

To Delete from the Cursor to the End of the Line

  1. Move the cursor to the first character that you want to delete, and press the Ctrl-A, Enter key sequence (the Enter function).

  2. Press the Delete key (the Delete Char function).

To restore text deleted this way, see To Restore the Last Deleted Text.

To Delete to the End of the Line and Join the Next Line

  1. Move the cursor to the first character that you want to delete, and press the Ctrl-A, Enter key sequence (the Enter function).

  2. Press the Ctrl-A, Delete key sequence (the Delete Line function) to delete the rest of the line and move the following line into the deleted space.

To restore text deleted this way, see To Restore the Last Deleted Text.

To Restore the Last Deleted Text

Move the cursor to the line where you want the text restored, and press the Ctrl-A, I key sequence (the Restore function) to restore the last deleted text or line at the cursor line location.

Each time you delete lines of text, the editor stores the deleted text in a stack buffer.

When you press the Ctrl-A, I key sequence, the editor restores the last deleted text at the cursor line, moving the cursor line down to make room for the restored text.

If you continue to press the Ctrl-A, I key sequence, the editor restores all of the text you deleted in the current editing session.

For example, if you delete lines 2, 3, and 4 of the following text:


1 uuuuuuuuuuuuuuuu
2 The ABC Company
3 1234 North Drive
4 Austin, TX
5 vvvvvvvvvvvvvvvv

the text looks like this:


1 uuuuuuuuuuuuuuuu
5 vvvvvvvvvvvvvvvv

and the delete buffer contains:


4 Austin, TX
3 1234 North Drive
2 The ABC Company

If the cursor is under a character on line 5 and you press the Ctrl-A, I key sequence one time, the result is:


1 uuuuuuuuuuuuuuuu
4 Austin, TX
5 vvvvvvvvvvvvvvvv

If you press the Ctrl-A, I key sequence two more times, the result is:


1 uuuuuuuuuuuuuuuu
2 The ABC Company
3 1234 North Drive
4 Austin, TX
5 vvvvvvvvvvvvvvvv

To Restore More Than One Copy of the Last Deleted Line

  1. Move the cursor to the line where you want the text restored, and press the Ctrl-A, Enter key sequence (the Enter function).

  2. Type the number of copies you want restored in the ENTER box, and press the Ctrl-A, I key sequence (the Restore function).

How to Move, Copy, and Delete Marked Text with the INed Editor

When you pick up text, you take it out of its place in the file being edited and store it temporarily in a buffer. You can then put it down somewhere in the file, or you can put down a copy of it, leaving the text itself in the buffer.

Blocks of text can be complete lines of text, boxes of text, or text lines. Mark the text depending on your need. For example, it is usually better to box-mark text in a column format and text-mark sentences within a paragraph.

You can use motion functions such as the Ctrl-A, Page Up (the Page Up function); Ctrl-A, Page Down (Page Down function); Ctrl-A, L (Left function); Ctrl-A, R (Right function) key sequences, and the Enter key (Return function) either to begin to mark text or to continue to mark text.

The way the editor makes space for the text you move or copy depends on how you marked the text:

You can use the following procedures:

To Mark Complete Lines of Text

  1. Place the cursor on either the first or last line that you want to mark, and press the Ctrl-A, Enter key sequence (the Enter function).

  2. Use the Up or Down Arrow keys to mark a block of text consisting of complete lines of text.

    The editor highlights the column of text in which the cursor is moving.

    Note: Do not use the Right or Left Arrow keys. If you move to a different column, the editor marks the text as a box.

To Unmark Text

To unmark text, press the F4 key (the Cancel function) before you pick up or delete the marked text.

To Mark a Box of Text

When you mark a box of text, you indicate the upper-left corner and the lower-right corner of the box.

  1. Place the cursor at the upper-left corner of the area you want to mark, and press the Ctrl-A, B key sequence (the Box Mark function).

    The following message replaces the full path name at the bottom of the screen:

    ****BOX/LINE**** 
  2. Move the cursor one column to the right of the lower-right corner of the box area.

    The editor highlights the text from the beginning cursor position to the current cursor position. You can use most of the cursor control keys or window scrolling keys. Most of the other function keys and text entering keys do not work.

    Note: You must end a box mark one column to the right of the text you want to mark.

To Mark Text

When you mark text, you indicate the first and last letters of the text.

  1. Place the cursor under the first letter of the text, and press the Ctrl-A, T key sequence (the Text Mark function).

    The following message replaces the full path name at the bottom of the screen:

    *******TEXT*******
  2. Move the cursor one column to the right of the last letter of the text.

    The editor highlights the text from the beginning cursor position to the current cursor position. You can use most of the cursor control keys or window scrolling keys. Most of the other function keys and text entering keys do not work.

    Note: You must end the text mark field one character or space to the right of the text you want to mark.

To Pick Up Text

Mark the text or place the cursor on a line of text, and press the F7 key (the Pick Up function).

The marked text (or line of text) is removed from the window and is placed in the pick-up stack buffer.

To Pick Up a Copy of Text

Mark the text or place the cursor on a line of text, and press the F9 key (the Pick Copy function).

The marked text remains in the window and a copy is placed in the pick-up stack buffer.

To Put Down the Text from the Text Buffer

To put down the latest text in the pick-up stack buffer, move the cursor to the top-left position of the place where you want to put down the text, and press the F8 key (the Put Down function).

The editor removes the latest text in the pick-up stack buffer and puts it down at the cursor position. The next text in the stack buffer is then available to be put down.

To Put Down a Copy of the Text from the Text Buffer

To put down a copy of the latest text in the pick-up stack buffer, move the cursor to the top-left position of the place where you want to put down the text, and press the F10 key (the Put Copy function).

The editor puts down a copy of the text in the pick-up stack buffer but leaves the original copy in the stack buffer. You can press the F10 key to put a copy of this text in several places, one copy at a time.

To Put Down the Text from the Buffer Multiple Times

  1. Move the cursor to the top-left position of the place where you want to put down the text, and press the Ctrl-A, Enter key sequence (the Enter function).

    The editor displays the ENTER box.

  2. Type the number of copies you want inserted at the cursor position, and press the F8 key (the Put Down function).

To Put Down Multiple Copies of the Text from the Buffer

  1. Move the cursor to the top-left position of the place where you want to put down the text, and Press the Ctrl-A, Enter key sequence (the Enter function).

    The editor displays the ENTER box.

  2. Type the number of copies you want inserted at the cursor position, and press the F10 key (the Put Copy function).

To Delete Marked Text

Mark the text you want to delete, and press the Ctrl-A, Delete key sequence (the Delete Line function).

To Put Down Deleted Text

Move the cursor to the top-left position of the place where you want to put down the text, and press the Ctrl-A, I key sequence (the Restore function).

Note: Once you put down deleted text, the editor removes it from the delete buffer.

How to Search for and Replace Text with the INed Editor

You can use the following procedures with INed editor subcommands:

To Search for a Character String

  1. Press the Ctrl-A, Enter key sequence (the Enter function).

  2. Type in the ENTER box the character string you want to find.

    Character strings are words or text you specify. When the editor finds the character string, the editor scrolls the window to display the character string, placing the cursor on the string's first character.

  3. To search down toward the end of the file for the character string, press the Ctrl-A, Down Arrow key sequence (the Search Down function).

    To search up toward the beginning of the file for the character string, press the Ctrl-A, Up Arrow key sequence (the Search Up function).

    Use the following guidelines when you search for text:

    To stop a search before it completes processing, press the Ctrl-C key sequence (the Break function). The editor displays the following message:
    Stopped. 
    If the search completes before you press the Ctrl-C key sequence, the operation is not undone.
    Note: Some keyboards have the word Break engraved on a key. This key is not necessarily equivalent to the Ctrl-C key sequence (the Break function).
  4. Continue to press the Ctrl-A, Down Arrow or Ctrl-A, Up Arrow key sequence to search for other occurrences of the character string.

To Search for Another Occurrence of a Word

  1. Move the cursor to the first character of the word to be used as the search character string, and press the Ctrl-A, Enter key sequence (the Enter function).

  2. To search down toward the end of the file for the character string, press the Ctrl-A, Down Arrow key sequence (the Search Down function).

    To search up toward the beginning of the file for the character string, press the Ctrl-A, Up Arrow key sequence (the Search Up function).

When you search for an existing word, the search character string begins at the character the cursor is on and ends at the character in front of the next blank. For example, if the cursor is on the letter r in the word bright and you press the Ctrl-A, Enter key sequence, and then the Ctrl-A, Down Arrow key sequence (the Search Down function), the editor looks for the next occurrence of the character string right .

To Replace Text

  1. Press the Ctrl-A, Enter key sequence (the Enter function) and type in a word to search for in the ENTER box.

  2. Press the Ctrl-A, Down Arrow or Ctrl-A, Up Arrow key sequence to move the cursor to the text you want to replace.

  3. Press the Ctrl-A, Enter key sequence (the Enter function).

  4. To replace the text, type the new text in the ENTER box.

  5. Press the Ctrl-A, = key sequence (the Replace function).

  6. Repeat steps 2, 3, and 5 until you replace all instances of the text string.

    For example, to search for blossom and replace it with bloom in the following text:

    
    Blue Sage is one of the most widely distributed
    Salvia species. In Texas it starts to blossom in
    April and continues to blossom much of the summer.
    Press the Ctrl-A, Enter key sequence, type the word blossom in the ENTER box, and press the Ctrl-A, Down Arrow key until you locate the first blossom you want to replace.

    Press the Ctrl-A, Enter key sequence, type the word bloom in the ENTER box, and press the Ctrl-A, = key sequence. The word blossom is in the search buffer, the word bloom is in the replacement buffer, and the text looks like this:

    
    Blue Sage is one of the most widely distributed
    Salvia species. In Texas it starts to bloom in
    April and continues to blossom much of the summer.
    Press the Ctrl-A, Down Arrow key sequence to find the next blossom and press the Ctrl-A, = key sequence. The text looks like this:
    
    Blue Sage is one of the most widely distributed
    Salvia species. In Texas it starts to bloom in
    April and continues to bloom much of the summer.
    Note: If you want to replace a text string throughout a file, you can use the rpl filter command.

Related Information

The rpl command in AIX Version 4.3 Commands Reference.

INed Editor Overview introduces general concepts about the INed editor, lists the INed editing functions and describes the system guidelines for using the INed editor.

INed Editor Functions for the Standard Keyboard is a table that shows the INed editor command keys on a standard keyboard.

INed Editor Files in AIX Version 4.3 Files Reference contains reference information about the files used by the INed editor.


[ Previous | Next | Contents | Glossary | Home | Search ]