-------- EDIT QUICK REFERENCE -------- Probably the best editor in existance. This chart was created by NonStopTools. Please feel free to copy this, improve it, and send a copy to Jim.Cutlar@nonstoptools.com. =============================================================================== EDIT: MUST READ =============================================================================== These are things you need to know before reading the Edit Command Syntax ------------------------------------------------------------------------------- All Commands = may be entered in either uppercase or lowercase. * Example = Examples in this document are preceeded by "*" * 1001'This is an example.' ------------------------------------------------------------------------------- L(ist) A(ll) = The command may be entered as either 'List' or 'L'. * LIST ALL * LA * list A ------------------------------------------------------------------------------- [optional] = The entry is optional. ------------------------------------------------------------------------------- X|Y = X or Y. The "|" character means OR. ------------------------------------------------------------------------------- "x" 'x' /x/ = A string may be surrounded by matching symbols ' " or / * LIST"string";LIST'string ',LIST/string/ ------------------------------------------------------------------------------- Modifiers = May preceed strings. Only the first letter needs to be entered. * LB/hello/ is the same as LIST BOTH/hello/ ------------------------------------------------------------------------------- line = Specifies one line number may be entered. These include F(irst), L(ast), 9, 9 + 1, 9 - 1, *, *+1, L+1 ------------------------------------------------------------------------------- lines = Examples used L(ist), which may be entered as List or L. 9 = Line Number 9 * L9 lists line 9. 99 = Line Number 99 * L99 lists line 99. 9/99 = Lines 9 through 99 * L9/99 lists lines 9 through 99. 9 20 24 = Lines 9, 20 and 24 * CF/Begin/ 9 20 24 Adds Begin to lines 9, 20 and 24. F(irst) = First Line * List First list the first line L(ast) = Last Line * LL A(ll) = F/L * LA * = This Line * L* * + .001 = This line plus .001 * LB/procedure division/ List all lines with PROCEDURE DIVISION. * *+.001/ COPY DECLARATIVES/ adds COPY DECLARATIVES after the last line found with PROCEDURE DIVISION. 9 + .001 = Line 9 Plus .001, which would be 9.001 * L*+1 List the current line plus 1. R/string/ = Lines including the string. Use this like an AND in searches. * L9/99 R/string/ List lines with "string" in lines 9 though 99. ------------------------------------------------------------------------------- col = Specify 1 column. May be: F(irst), L(ast), 9, 999 * CL/./99 Add a period to line 99. ------------------------------------------------------------------------------- cols = Specify a range of columns 9 = Column 9 * C9"Hello"A adds "Hello" to all lines at column 9. 99 = Column 99 * C999"goodbye"A adds "goodbye" to all lines at column 99. 9:99 = Column 9 through Column 99 * C1:10//A Changes columns 1 through 10 to nothing on all lines. 9:12 20:25 = Columns 9 through 12 and columns 20 through 25 F(irst) = First Column * Cf/comment /a Adds "comment " to the beginning of all lines. L(ast) = Last Column * CL/./a Adds a period "." to the end of all lines. A(ll) = F:L * CA/hello/goodbye/a Changes all "hello"s to "goodbye" in all lines. 9 15:20 999 = Columns 9, 15 through 20 and column 999 * C1 10 20'|'a Change columns 10 and 20 to "|" on all lines ------------------------------------------------------------------------------- StringRange "string" = Lines containing "string" * L"string" list lines with "string". /string/ = Lines containing "string" * L/string/ list lines with "string". 'string' = Lines containing "string" * L'string' list lines with "string". N(ot) 'st' = Lines that do not contain "st" * LN'st' list lines that do not contain "st". W(ord) = Find strings surrounded by " ",First Column or Last Column * LW"hello" finds "Hello there" but not "Hellosoft". B(oth) = Find strings in either Uppercase or Lowercae * LB"Hellow" finds "hello" and "HeLLo". cols = Find Strings found in specified columns * L9:99"Hello" finds " Hello" but not "Hello". Little Known Secret: line/String/ = Either replaces or changes the line. * LA 1 ABC 2 DEF 3 GHI * 2/NonStopTools/ * LA 1 ABC 2 NonStopTools 3 GHI =============================================================================== RUN SYNTAX: (because all NonStop Utilities are not created equal). =============================================================================== EDIT [/[INLINE,IN filename,OUT filename]/] filename [!][;command1][;command2] filename Any Guardian file name. ! If filename doesn't exist, create it. command Any Edit Command Examples: 1. Create an Edit Obey file. TACL> EDIT editcmds;1"LIST ALL";2"EXIT";e 2. Execute the Edit commands using /IN filename/ TACL>EDIT /IN editcmds/filename 3. Execute the Edit commands using OBEY TACL>EDIT filename;OBEY editcmds TACL>EDIT filename;O editcmds 4. Execute the Edit commands using INLPREFIX TACL>INLPREFIX .. TACL>EDIT /INLINE/filename TACL>.. LIST ALL TACL>.. EXIT TACL> ------------------------------------------------------------------------------- Edit a file of almost any type, with up to 255 character width ------------------------------------------------------------------------------- EDIT filename;set CONTROL;PUT editfile [!] filename Any Guardian File Type editfile An Edit file EDIT relativefile PUT editfile ! == Converts a guardian file to EDIT format FUP PURGEDATA relativefile FUP COPY editfile, relativefile == Puts the contents back. =============================================================================== EDIT COMMAND SYNTAX =============================================================================== A(dd) linenumber|/text string/|"text string"|'text string" Example: EDIT filename *A 10 10 text entry 1 11 text entry 2 12 // * Note: Entering // takes you out of add mode. ------------------------------------------------------------------------------- A(dd) [Q(uiet)] [lines [BY increment]] *ADD 1 Hey diddle diddle 2 The cat and the fiddle 3 The cow jumped 4 Over the moon. 5 // * ------------------------------------------------------------------------------- BREAK [lines] [AT cols] 1. Break all lines at several strings columns. *la 45 Jack be nimble, Jack be quick, Jack jump over the candlestick. *BREAK 45 AT "Jack" "Jack" "Jack" 45 Jack be nimble, 45.1 Jack be quick, 45.2 Jack jump over the candlestick. ------------------------------------------------------------------------------- C [cols] /findstring/replacestring/ [lines] [Range] 1. Add Comment to the beginning of all lines *C1"Comment "A 2. Change columns 1 through 8 to nothing in all lines. *C1:8//A 3. Change all Hello's to GoodBye in all lines. *CBA"hello"GoodBye"A 4. Change all x's to y's in lines 9 through 20, that contain "z" or "Z" *CBA"x"y"1/20 RB'z' ------------------------------------------------------------------------------- D(elete) [Q(uite)] [lines] [!] 1. Delete lines 10 through 20 *d10/20 2. Delete all lines containing "goodbye" or "GoodBye". *db/goodbye/ 3. Delete all lines, do not echo it, and do not ask if its okay. *dqa ! ------------------------------------------------------------------------------- E(xit) ------------------------------------------------------------------------------- F(ix) [command] - Fixes a command previously entered. It echos the command, then lets you modify it underneath. [command] may be: number, a string, or nothing to indicate the last entry. F(ix) [lines] - Fixes editor lines. F(ix) C(ommand) - Fixes the last command entered. Examples of Fix use the following edit line 8 123456789. 9 ABCDEFFFGHIJKLLNORSTUVW 10 123456789. All Fix commands throughout the Guardian system follow this subset of commands: I - Insert R - Replace D - Delete // - Stops the subcommand 1. Fix Line 9 contain A through Z. * F9 9 ABCDEFFFGHIJKLLNORSTUVW RM press enter 9 ABCDEFFFGHIJKLMNORSTUVW In IPQ// IXYZ press enter 9 ABCDEFFFnGHIJKLMNOPQRSTUVWXYZ DDDD press enter 9 ABCDEFGHIJKLMNOPQRSTUVWXYZ press enter *LA 8 123456789. 9 ABCDEFGHIJKLMNOPQRSTUVWXYZ 10 123456789. * ------------------------------------------------------------------------------- G(et) filename [ [READ]|[!] ] [lines] [TO L(ast) [BY increment]] 1. Add the first line of File2 to end of File1 * GET File2;LIST ALL 1 2 HELLO 3 * GET File1;LIST ALL 1 123456789. 2 ABCDEFFFGHIJKLLNORSTUVW 3 123456789. * GET file2 to last * la 1 2 HELLO 3 4 5 HELLO 6 * G(et) filename [ [READ]|[!] ] [lines] TO SAME [KEEP] 2. Get File2 and overlay File1's lines with the same line number * GET File2;LIST ALL 1 2 HELLO 3 * GET File1;LIST ALL 1 123456789. 2 ABCDEFFFGHIJKLLNORSTUVW 3 123456789. * GET file2 KEEP1 to SAME * la 1 2 HELLO 3 4 3. Get File2 and overlay File1's lines with the same line number Example of Fix uses the following * GET File2;LIST ALL 1 2 HELLO 2.1 * GET File1;LIST ALL 1 123456789. 2 ABCDEFFFGHIJKLLNORSTUVW 3 123456789. * G file2 KEEP1 to SAME KEEP * la 1 123456789. 1 2 ABCDEFFFGHIJKLLNORSTUVW 2 Goodbye 2.1 2.1 3 123456789. G(et) filename [P(ut) filename2 [!]] 2. Get an indexed file and put it into an editfile * SET CONTROL - Allow non Ascii characters. * G Names P NameEdit! * FIX 201 - Fix Record number 201 12345678A..JIM CUTLAR 702203825703311972 * ddddiJOHN 12345678A..JOHN CUTLAR 702203825703311972 * // * TACL> fup purgedata Names TACL> fup copy NameEdit,Names,recin 100,recout 100 ------------------------------------------------------------------------------- I(mage) [stringrange] "begin"replacement"end" lines 1. Replace everything between '4' and '8' with 'abcdefg' * LA 1 123456789 * Image All "4"abcdefg"8" All * list all 1 1234abcdefg89 I(mage) [stringrange] END "end"addstring" lines 2. Insert "abcdefg" after "4" * LA 1 123456789 * Image All "4"abcdefg" All * list all 1 1234abcdefg56789 ------------------------------------------------------------------------------- J(oin) [Q(uit)] [lines] [W(idth) col ] Join works with Q(uery) and S(et) 1. Join all lines at column 50. * Set Join 50 * Join All 2. Join all lines at column 41. * Join All WIDTH 41. ------------------------------------------------------------------------------- L(ist) [S(eq)][U(nseq)][col] [O(ut) listfile] [lines] 1. List all lines with "MOVE" and "TO" to a spooler file. * LIST UNSEQ OUT $S.#MOVE "MOVE" R"TO" ------------------------------------------------------------------------------- M(ove) [C(opy)] [Q(uiet)] [lines TO line [line ...] M(ove) [C(opy)] [Q(uiet)] BY line [,line ...] 1. Examples of Move and Move Copy * LA 1 ABC 2 DEF 3 GHI * MC 3 to 1.1 * LA 1 ABC 1.1 GHI 2 DEF 3 GHI * M 2/3 to .1 BY .1 * LA .1 DEF .2 GHI 1 ABC 1.1 GHI ------------------------------------------------------------------------------- N(umber) lines [BY incr] N(umber) line TO line [BY incr] 1. Renumber all lines * NA 2. Renumber lines 10 through 20 by .001 * N 10/20 BY .001 ------------------------------------------------------------------------------- O(bey) filename [QUIET] 1. Obey an edit command file * O editcmds ------------------------------------------------------------------------------- P(ut) filename [!] [lines|stringrange] [R(ange) lines|stringrange] 1. Put all lines from the current file (containing MOVE and TO) into newfile. * PUT newfile ! /MOVE/ R/TO/ ------------------------------------------------------------------------------- Q(uery) [,N(ame)][,B(lock)][,D(itto)][,I(nlen)][,O(utlen)] [,S(hift)][,C(ontrol)][,F(req)][,J(oin)][,Q(uiet)][,T(abs)] ------------------------------------------------------------------------------- R(eplace) [Q(uite)] [line] to [line] Manually replace each of the lines. Enter // to end it. ------------------------------------------------------------------------------- R(eplace) B(lock) ------------------------------------------------------------------------------- S(et) SET setoption [, setoption ... ] | | Set[,(B)lock 1..24] |Max lines to display in block mode. [,(C)ontrol|Nocontrol] |Allow control characters (non Ascii) [,NoDitto|(D)itto "Char"] |NODitto. Used with ADD. [,(F)req 1..5000] |Controls when Edit updates the edit file [,(I)nlen 1..255] |Used with GET [,(J)oin 10..255] |Used as default for JOINs with no WIDTH. [,(O)utlen 1..255] |Used with LIST for non-disk files. [,(NOQUITE|(Q)uiet |Default for CHANGE and DELETE. [,NOSHIFT|(S)hift |Shifts all characters entered to uppercase. [,NOTABS|(T)abs [col1] [col2]...]|Sets Tabstops. 1. Create G macro to Edit with tabs set to every 10 columns. TACL> EDIT G ! *A ?TACL MACRO EDIT %1%;SET TABS 10 20 30 40 50 60 70 80;%2 to 99% // RUN G filename *qn FILE IS: FILENAME *e ------------------------------------------------------------------------------- T(edit) [filename] [R(eadonly)][A(nyway)][!] [filename] - If missing the current file is used. R(eadonly) - Edits the file without update access. A(nyway) - If security allows it, edits the file in update mode. ------------------------------------------------------------------------------- XVS [line] Puts the editor in Block mode. .-----.---------.---------.---------.---------.----.---------.---------.---------.---------.-----.---------.---------.---------.---------. | | F1 | F2 | F3 | F4 |||||| F5 | F6 | F7 | F8 ||||||| F9 | F10 | F11 | F12 | .-----.---------.---------.---------.---------.----.---------.---------.---------.---------.-----.---------.---------.---------.---------. |Alt S|Go to 2 |Ins Col |Del Col |Undo Page||||||Super Sht|Exit | | ||||||| | | | | |Alt |Mark Page|Find Str |Menu |No Change||||||Goto EOL |Tab | | ||||||| | | | | .-----.---------.---------.---------.---------.----.---------.---------.---------.---------.-----.---------.---------.---------.---------. |Shift|BOF |EOF |Back 1 |Ahead 1 ||||||Ins Page |Cut Page |Get Page |Copy Page|||||||Def Page |Goto 1 |Goto 2 |Ins Col | | Norm|Page Down|Page Up |Back 8 |Ahead 8 ||||||Ins Line |Cut Line |Get Line |Cpy Line |||||||Brk Line |Join Line|Mark 1,2 |Find Str | .-----.---------.---------.---------.---------.----.---------.---------.---------.---------.-----.---------.---------.---------.---------. Super Shift. Use SF15 to get out of it. Its useless. Alt F3 - Menu ............................................ . VIRTUAL SCREEN - T9601B30 - (08MAR87) . That's right! 1987!!! . LINENO [1] <- . Show current line . [W][B]"string" <- . F12 Finds the next string. . JOIN WIDTH [70] <- . Join width 80 is best. *SJ80 . COMMAND . Not implemented. . (PRESS ANY FUNCTION KEY TO SIGNAL ENTRY) . . GOTO-1 = UNDEFINED . Press F11 SF10 to set this . GOTO-2 = UNDEFINED . Press F11 SF11 to set this . RETN = UNDEFINED . Press F11 F11 to set this. ............................................ ------------------------------------------------------------------------------- ?ENV [System]|[Volume] ------------------------------------------------------------------------------- ?FILES [[\System.][$Vol.][Subvol]] ------------------------------------------------------------------------------- ?SYSTEM [\System.] ------------------------------------------------------------------------------- ?VOLUME ?VOLUME [ [ $volume.] [ subvolume ] ] -------------------------------------------------------------------------------