Google
 

Trailing-Edge - PDP-10 Archives - bb-m836d-bm - tools/sed/sed.xct
There are 13 other files named sed.xct in the archive. Click here to see a list.
;TO LOAD ONE OF THESE EXECUTE STRINGS POSITION TO THE START OF THE LINE; TYPE
;<ENTER><END-LINE><EXECUTE>  (or <ENTER><LINE><EXECUTE>	)


;IN A MACRO PROGRAM, TO CHANGE OP-SPC-ARG TO OP-TAB-ARG AND ADJUST COMMENT:

W^TB^TB^CL^IF (^TA)^TB^IF;(^FCG33(^DC))^RT

;TO DELETE ALL LINES WITH PRE-SET SEARCH KEY (SF==<KEY>)

W^ST($1^DL)^SF^LB^DL

;TO COPY ALL LINES WITH SEARCH KEY TO ALTERNATE FILE:
;(SF==<KEY>) [BEST ALTERNATE FILE IS END OF CURRENT FILE]

W^ST($1^PK)^SF^RT^CU^PK^RT^FL^PT^RT^FL

;SAME, BUT DELETE LINES AS THEY ARE FOUND (SF==<KEY>):

W^ST($1^DL)^SF^RT^CU^DL^FL$^PT^RT^FL

;TO PUT ALL COMMENTS STARTING AFTER COL 16 AT 4TH (OR 5TH) TAB:
;(SF=<KEY>, /NOICR, IM)

W^ST($1^DS)^SF^FCG16(^CL^DW^S(^DS^CL)^CR^4(^FCL32(^TA)))^CL^IF^C(^CR )^RT
W^ST($1^DS)^SF^FCG16(^CL^DW^S(^DS^CL)^CR^5(^FCL40(^TA)))^CL^IF^C(^CR )^RT

SED/XB5:
	^ST($1^DS)
	^SF
	^FCG16(
		^CL
		^DW^S(^DS^CL)
		^CR
		^4(^FCL32(^TA))
		^CL
		^IF^X^S(^CR )
		)
	^RT

;TO CONVERT MULTIPLE SPACES TO TABS:

W^ST($1^DS$IM+T:8^SW)^TB^7(^IF^E(^XB)^CL^IF (^DW (^DS^CL)^CR^TA)^CR^TB)^RT

	^ST($1^DS$IM+T:8^SW)
	^TB
	^7(
		^IF^E(^XB)
		^CL
	        ^IF (
			^DW (^DS^CL)
			^CR
			^TA
			)
		^CR
		^TB
		)
	^RT

;TO CHANGE ONE-SPACE TABS TO SPACES:

W^ST($^TA)^SF^CL^IF^C(^CR^CR^IF^C(^CL ))^CR

;TO CONVERT TABS TO SPACES:

W^ST($NIM+NRES+T:W^SW$^TA)^SF$^TB^DS^IS