CodePudding user response:
Using sed to replace good sed 's/& lt; Li>/& lt; Ul>Or replace with the inside of the vi
: % s/& lt; Li>/& lt; Ul>
: % s # & lt;/li> # & lt;/li> # g (avoid conflict and/ul slashes, use # space)
Also a kind of solution is matching with & lt; Li> Line, the beginning of a line operator ^ replace & lt; Ul> And end-of-line character $replace & lt;/ul>
Sed -i '/& lt; Li>/s/^ & lt; Ul>/'file. TXT
Sed -i '/& lt; Li>/s/$/& lt; \/ul>/'file. TXT
CodePudding user response:
You use thevi or vim?Look at the following output point to what
readlink - e $(which vi)
In addition to using replace function (vim yourself or sed or awk),
Just for the beginning or end can also be like this:
# in the replacement period of the first line of the
# command mode
0
# visual mode
Ctrl + v
# move to the replacement period of the last line of the
J # many times
# insert mode
I
# enter the characters want
# to return to command mode
ESC
# etc. Moments later, the results
In the add at the end, do the following changes to the
0 - & gt; $
I - & gt; A
CodePudding user response:
Is there a better way? Top up!!!!!