<p>I have a directory full of files and I need to pull the headers and footers off of them. They are all variable length so using head or tail isn't going to work. Each file does have a line I can search for, but I don't want to include the line in the results.</p>

<p>It's usually </p>

<pre><code>*** Start (more text here)
</code></pre>

<p>And ends with </p>

<pre><code>*** Finish (more text here)
</code></pre>

<p>I want the file names to stay the same, so I need to overwrite the originals, or write to a different directory and I'll overwrite them myself.</p>

<p>Oh yeah, it's on a linux server of course, so I have Perl, sed, awk, grep, etc.</p>

Maybe? Start to Finish with not-delete.
```
```
$ sed -i '/^\*\*\* Start/,/^\*\*\* Finish/d!' *
```
```
or...less sure of it...but, if it works, should remove the Start and Finish lines as well:
```
```
$ sed -i -e '/./,/^\*\*\* Start/d' -e '/^\*\*\* Finish/,/./d' *
```
```
```
d!
```
may depend on the build of
```
sed
```
you have -- not sure.
And, I wrote that entirely on (probably poor) memory.