Seemingly simple sed, delete between matching lines

There are many matching blocks of text in one file that need to be deleted. This example below is one block that needs to be either deleted or replaced with an empty line.
This text below is the input file. The ouput file should be empty

Searching Checks. Based on search criteria
name: Value :  CPU
name: Value :  Memory
name: Value :  RX_Errors
name: Value :  RX_Errors1
name: Value :  TX_Errors
name: Value :  TX_Errors1
name: Value : ACE thresholds - Access List Limit
name: Value : ACI Fabric - DVS has been deleted
name: Value : ACI LAS-F01 - IS-IS Route Adjacencies Lost
name: Value : IVR Hours Of Operation 
name: Value : IVR Hours Of Operation - 
name: Value : Glance Cobrowse Waiting Check
name: Value : Glance Video Check
name: Value : DP_GLUSTER_DISK_IO_STAT
name: Value : Carbon_CPU

I want to remove the entire block. Here are some examples I have tested but am unable to remove the block of text. Any ideas?

#!/bin/bash -x 

#The below line works
sed '/two/,/nine/d' newnumber > 1number 

#This line works
#sed -i 's/Searching Checks.*name: Value : Carbon_CPU//g' test1 > 3test

#name: Value :  TX_Errors1
#sed -i 's/Searching Checks.*name: Value :  TX_Errors1//g' test1 > 3test

sed '/Searching Checks.\ Based\ a\ search\ criteria/,/name:\ Value\ :\ Carbon_CPU/d' test1 >> 4test 
#These may not work
#sed '/Searching Checks. Based a search criteria/,/name: Value : Carbon_CPU/d' test1 

Last line should work but with a minor modification:

sed '/Searching Checks. Based on search criteria/,/name: Value : Carbon_CPU/d' test1

1 Like

I also had to use

:set list

in vi to show hidden characters. In my case it only showed the end line character which we know is in place anyway. I cut and pasted back into my script and that is what is took in addition to correcting my typo. Including the $ end line character should not be necessary but that is what it took to make this run.

sed '/Searching Checks. Based on search criteria$/,/name: Value :  TX_Errors1$/d' test1