home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.misc
- Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!data.nas.nasa.gov!wilbur.nas.nasa.gov!hampe
- From: hampe@wilbur.nas.nasa.gov (Andrew F. Hampe)
- Subject: Re: Regular expression, vi and sed
- Keywords: RE, VI, SED
- References: <1992Dec24.050436.13946@organpipe.uug.arizona.edu> <1992Dec24.234801.20080@netcom.com>
- Sender: news@nas.nasa.gov (News Administrator)
- Organization: OnlyWhereRequiredByLaw
- Date: Thu, 31 Dec 92 07:01:18 GMT
- Message-ID: <1992Dec31.070118.17956@nas.nasa.gov>
- Lines: 33
-
- In article <1992Dec24.234801.20080@netcom.com> messina@netcom.com (Tony Porczyk) writes:
- >ron@argus.lpl.Arizona.EDU (Ron Watkins) writes:
- >
- >>I have a problem which I don't understand. First, I would like to delete
- >>a bunch of blank spaces that I have in a very large file. VI can't do it
- >>because there isn't enough space in /var or /tmp or whatever. So I tried
- >>using sed as follows:
- >>sed -e "s/^ +//" < in > out"
- >>and it didn't work.
- >
- >Try:
- >
- >sed -e "s/^[ ]*//" < in > out
- >
- >t.
-
- how about:
-
- sed -e 's/[ ][ ]*/ /g' < in > out
-
- this would reduce all occurances of more than one space to
- just one space on any given line.
-
- the bit with the "^" is limiting it to just the start of
- the lines, or am I missing why we are trying to deal with
- only the starts of lines?
-
-
- ciao
- drieux
-
-
-
-