Article View: comp.editors
Article #2473Re: Arbitrary text blocks (Was: VI??? GROSS!)
From: Jeff Wang
Date: Tue, 17 Nov 1992 06:52
Date: Tue, 17 Nov 1992 06:52
48 lines
2496 bytes
2496 bytes
bvaughan@sheps.Princeton.EDU (Barbara Vaughan) writes:
|> Back in the days when I mostly worked with MSDOS and had a good editor
|> that handled rectangular blocks easily, I used to use it to prepare data
|> so I COULD read it into a spreadsheet or word processor. For instance, if
|> I have a file of formatted data:
|>
|> 123456789
|> 987654321
|>
|> I can use my editor to insert a column of blanks in front of each field so
|> it can be read into a spreadsheet program:
|>
|> 12 34 56 78 9
|> 98 76 54 32 1
You could use :%s\(..\)\(..\)\(..\)\(..\)\(.\)/\1 \2 \3 \4 \5/
to do that.
|> Or if I have some ugly SPSS CROSSTAB output, where cells are separated by
|> dashes, plus signs and vertical bars:
|>
|> 1 | 23 |
|> -----+----+
|> | |
|> 3 | 45 +
|> -----+----+
|>
|> I can get rid of those vertical bar columns in a jiffy with a good
|> editor, so that I can do the rest of the job of making a nice document in
|> WordPerfect.
You could use :%s/|//g or :%s/[|+-]//g to do that.
|> I also found this feature useful when writing programs. Let's say I have
|> a section of code I decide to make conditional, so I want to indent it to
|> make an "if.. then.." block. I just insert a column of blanks in front of
|> that section of code.
You could use :'a,'bs/^/ / to shift a block to the right.
--
#====}==) #===(==} #====}==) #===(==} {==)===# (=={====# {==)===# (=={====#
>> Jeff Wang Net : hjiwa@gruc19.nor.chevron.com <<
>> Chevron Petroleum Technology Company Profs : hjiwa (hovmb) <<
>> Geophysical/Geological Applications Phone : (504) 592-6162 <<
>> 935 Gravier Street, Room 1006 Fax : (504) 592-6958 <<
>> New Orleans, Louisiana 70112 Valeo,vales. Die dulci fruimini!! :) <<
#====}==) #===(==} #====}==) #===(==} {==)===# (=={====# {==)===# (=={====#
Technical Details
Message-ID:
<1992Nov17.005252@gruc19.nor.chevron.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!lhdsy1!nntpserver.chevron.com!gruc19.nor.chevron.com!hjiwaReferences:
<1992Nov16.065935.27173@rc.nokia.fi> <1992Nov16.221338.42264@datamark.co.nz> <1992Nov17.145011.24541@Princeton.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!lhdsy1!nntpserver.chevron.com!gruc19.nor.chevron.com!hjiwa From: hjiwa@gruc19.nor.chevron.com (Jeff Wang) Newsgroups: comp.editors Subject: Re: Arbitrary text blocks (Was: VI??? GROSS!) Message-ID: <1992Nov17.005252@gruc19.nor.chevron.com> Date: 17 Nov 92 06:52:52 GMT References: <1992Nov16.065935.27173@rc.nokia.fi> <1992Nov16.221338.42264@datamark.co.nz> <1992Nov17.145011.24541@Princeton.EDU> Sender: news@nntpserver.chevron.com (USENET News System) Organization: Chevron Petroleum Technology Company Lines: 48