On 03/21/12 04:42, Jeri Raye wrote:
I have a compiler log with too many lines.
I would like to strip that document to only the lines I want.
How to that?
For example, I have a text like this
+--START OF TEXT --+
Boring line
Not interesting line
Useless line
Blabla
THIS IS REALLY AN INTERESTING BLOCK OF TEXT
[111]
[222]
[333]
LAST LINE OF REALLY AN INTERESTING BLOCK OF TEXT
Another boring line
Another not interesting line
SINGLE LINE OF INTERESTING TEXT (FOR EXAMPLE: TIMING MET, OR HEAP SIZE IS xxx))
Another useless line
+--END OF TEXT --+
Assuming you can mung with indentation, I'd do something like
:%left
:g/^THIS IS REALLY/sil! .;/^LAST LINE OF REALLY/>
:v/^^\s/d
:%left
The ":%left" strips off leading whitespace, the :g command
indents the sections you specify as interesting (you'll have to
tweak the regexps accordingly), the :v deletes all the stuff that
didn't get indented, and the last "%left" strips off the (added)
leading whitespace again.
-tim
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php