Subject: How? Delete Redundant Text

From: [email-masked] (Lawrence B. Renslow)
Date: Sun, 5 Feb 1995 23:12:23 -0800

I want to work with this header:

Date:         Sat, 7 Jan 1995 15:10:53 -0600
From: "L-Soft list server at NDSUVM1 (1.8a)" <[email-masked]>
Subject:      Automatic distribution (AFD) of file "FAMILY INDEX"
To: Multiple AFD recipients served by <[email-masked]>

This doesn't work:

: fw:.larryr.family.lock
^Subject:.*FAMILY*
| sed 's/Automatic distribution (AFD) of file//' family

I want to remove the redundant text in both the Subject and To lines.
And, what's the correct way to indicate "all characters remaining to end of
line" in the condition line?

Larry Renslow
[email-masked]

---

From: Roman Czyborra <[email-masked]>
Date: Mon, 6 Feb 1995 15:26:09 +0100 (MET)

> | sed 's/Automatic distribution (AFD) of file//' family

First, you only need to lock the door when flushing to a file, so the 
lockfile is unnecessary for filtering.  Second, you only want to filter 
the header so throw in a h flag.  Third, Y* means a random number of Ys.
Fourth, the argument "family" tells sed to read such a file instead of
the standard input.  You want to do

	: fhw
	^Subject:.*FAMILY
	| sed 	-e 's/:.*Automatic distribution (AFD) of file/:/' \\
		-e 's/Multiple AFD recipients served by //'