Change (Changing Columns)

Qedit 5.7 for HP-UX

Home Previous Next


Change (Changing Columns)

Replace some columns in some lines with a new string of characters. Use Change to insert columns, shift text left, or shift text right.

CHANGE column [/column] [(window)] "string" [rangelist]

(Q=no display, J=verify)

(Default: rangelist = *)

Change replaces the target column range with the string in the lines of the rangelist. You can use this to insert a string at a specified column. You can also use it to replace, expand, or contract specified columns.

If you specify a single column instead of a range, Qedit inserts the string before that column and shifts the rest of the line to the right. You can create new columns by inserting blanks in front of a position (e.g., change 5 " ").

If you specify a range of columns, Qedit replaces that column range with the string. The string may be the same length as the column range, longer, or shorter. If the string is shorter than the column range deleted, the rest of the line shifts left. If longer, the rest of the line shifts right. You can remove columns entirely by changing them to a null string (e.g., change 5/7 "").

Examples

/change 5"|"all      {draw vertical line of "|"s in file}
/cq 1/2 "" 10/15     {shift lines 10/15 left 2 spaces}
/cq 1 "   " 10/15    {shift lines 10/15 right 3 spaces}
/cq 1(1/8)" " all    {shift columns 1/8 right 1 space}
                     {don't change text beyond column 8}
/change 12/12 ::     {delete column 12 in the current line}

Notes

See the discussion of windows under "Changing Strings". Those notes also apply to column changes.

The first column number is usually 1, except for standard COBOL source files, where it is 7 (seven). The last column number depends on the current values for Set Language, Set Length, and Set Right.

Change prints each line modified, unless you use CQ. CJ asks you to verify each change.


Home Previous Next