[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Query on best programming practice

For years, I've had problems with changing lines with CI /// when similar
lines are stacked above another.
To give a simplified, artificial, example: suppose I want to change all
lines consisting only of the one word "Harry" to "Barry." So I use:

--{CrLf} being the red arrow you use on the command line for these things; I've omitted here the TF, BX, and Q2.

That command will not find the second Harry in a stack:


so the result of the CI command will be:

More generally, the same skipped elements result from running CI /xax/xbx/ on xaxaxaxa.

(Running SE /xax/ on xaxaxax shows why this happens.)
What is the best way to make sure no stacked elements are skipped? I've been simply running the command twice, repositioning the cursor at the Top of the File (CI/t not being 100% reliable):

But in the program in question, I do dozens of such CI's, so I want a more economical solution than doubling dozens of lines. It just occurred to me that I can solve the problem by double-spacing the file I'm running the program against. I need only do this once at the top of the program:

CI /{CrLf}/{CrLf}{CrLf}/

then I can reverse this at the end of the program.
But is there a better way? Maybe putting in a [NO ] between the lines? Then taking them out at the end?

Comments appreciated.