Matching all Characters between two Strings using Sed or any Unix command
<p>I have a log file and i want to delete all com.test.data text in my log file.In example below I want all occurrences in bold to be striped out.</p>

<p>The new lines after the text I want are causing havoc, removing all \n would ruin the entire.log file.</p>

<p>I have tried <code>grep -e 'com.test.data' debug.log --color -v &gt; test.log</code>.</p>

<p>Also tried <code>sed 's/com.test.data -\(.*\)2016-01/\1/' debug.log &gt; test.log</code>.</p>

<p>Also tried <code>sed '/'com.test.data -'/,/2016-01/ s/[a-z]*// p' debug.log &gt; test.log</code></p>

<p>All seem to fail.</p>

<p>My plan was find all text between 'com.test.data -' and '2016-01' replace all of this with 'empty'(delete all).
Then take my file and use grep to give me all lines except 'com.test.data -'.
 Doing this first seems to get me closer.</p>

<p>INPUT</p>

<pre><code>2016-01-05 14:45:05,264 com.test.data - blah blah blahsd

afdadfasdfsd
sdsdfsdffssfddsf

dfsdsfdfsdfdsdfs
fsdsdfdfs
2016-01-05 14:46:05,264 com.test.rest - Testing 123
2016-01-05 14:47:05,264 com.test.data - blah blah blahsd

afdadfasdfsd
sdsdfsdffssfddsf
dfsdsfdfsdfdsdfs

fsdsdfdfs
2016-01-05 14:46:05,264 com.test.rest - Testing 123
</code></pre>

<p>OR USE</p>

<pre><code>sed 's/^2016-01/@/' debug.log &gt; test.log //Add @ to beginning of file
</code></pre>

<p>Now its just finding text from com.test.data ---> @</p>

<p>NEW INPUT TO MAKE THINGS EASIER</p>

<pre><code>@-05 14:45:05,264 com.test.data - blah blah blahsd

afdadfasdfsd
sdsdfsdffssfddsf

dfsdsfdfsdfdsdfs
fsdsdfdfs
@-05 14:46:05,264 com.test.rest - Testing 123
@-05 14:47:05,264 com.test.data - blah blah blahsd

afdadfasdfsd
sdsdfsdffssfddsf
dfsdsfdfsdfdsdfs

fsdsdfdfs
@-05 14:46:05,264 com.test.rest - Testing 123
</code></pre>

<p>OUTPUT</p>

<pre><code>2016-01-05 14:46:05,264 com.test.rest - Testing 123

2016-01-05 14:46:05,264 com.test.rest - Testing 123
</code></pre>

<p>Any ideas?</p>