[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Stripping out characters
From: |
era+gmane |
Subject: |
Re: Stripping out characters |
Date: |
Mon, 12 Jul 2004 11:04:22 +0300 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
On 9 Jul 2004 06:18:34 -0700, zamdrist@pconline.com (Steve Schroeder)
posted to gmane.comp.gnu.utils:
> I have a space and a newline character between each file that I'm
> combining, I want to use grep to exlude this and output to a new
> file...for the life of me I can't figure this out...
What does "combining" mean in this context, and are you sure grep is
the right tool for whatever it is that you are trying to accomplish?
> ' \n'
> ' /n'
The regular expression for matching a space next to a newline is ' $'
but grep will merely output any line which matches this regular
expression; is that really what you need it for? "Strip out" sounds
like you'd be better of using something like sed or awk, or perhaps
csplit (this will create a new file every time it sees an occurrence
of a particular regular expression -- is that what you're looking
for?)
/* era */
--
formail -s procmail <http://www.iki.fi/era/spam/ >http://www.euro.cauce.org/
cat | more | cat<http://www.iki.fi/era/unix/award.html>http://www.debian.org/