[comp.editors] VI Hint requested

billd@infmx.informix.com (William Daul) (12/17/90)

USING VI....

1.  Given a number of lines that looked like this:

one two three four five six

How would I create a file that looked like this from the above:

one
two
three
four
five 
six  

Or:

one
  two
    three
      four
	five
	  six

2.  What is the lines looked like this:

one two three four
  one two     three four
one    two three four

Note for 2.: The columns could always have the same  strings in the same order
             but they might not be in the same character position.

pfeifer@helix.nih.gov (John Pfeifer) (12/17/90)

In article <1990Dec17.003156.28032@informix.com>, billd@infmx.informix.com (William Daul) writes:
|> USING VI....
|> 
|> 1.  Given a number of lines that looked like this:
|> 
|> one two three four five six
|> 
|> How would I create a file that looked like this from the above:
|> 
|> one
|> two
|> three
|> four
|> five 
|> six  

Easy enough -  :%s/\ /^V<CR>/g      (^V == crtl-V, <CR> == return)

|> 2.  What if the lines looked like this:
|> 
|> one two three four
|>   one two     three four
|> one    two three four

Ok, do the same as above and then - :g /^&/ d    (in this case, ^ is the carret
character)

If you want to be techincal, these are ex commands.

-John

-- 
#include <stdsig.h>

        John Pfeifer                    internet: pfeifer@alw.nih.gov

	"Jives! Jives!  Clear away this rubble and bring us another
	 tea set!"		-Lady Jowls