As long as there is a blank line following the segment you want to delete, the following should work:
sed '/^Something: Object[[:space:]]*$/,/^[[:space:]]*$/d' file
but this won't work if there is no blank line after the segment you want to remove (such as if it is the last segment in the file). If you also want to be able to delete that text if is is the last segment in the file and it doesn't have a blank line following it in that case, I find awk easier to use:
is conceptually what I had in mind; but didn't have a way of cobbling it all together. I'll take it out for a spin in just a shake
Yes, there will always be a blank line following the block to remove; so the end marker is valid. I just checked the EOF, and there are a couple of empty lines there, too; so all should be OK...
Apart from enormous skill, what does one look to for this type of syntax? It would be immensely helpful if there was an applet on a site somewhere to pop out the commands; but I guess the world isn't finished yet...
Thanks again, everyone, for the help!
---------- Post updated at 04:16 PM ---------- Previous update was at 03:45 PM ----------
Yep, worked like a charm.
The only modification I added was the -i after sed --
If you are serious about learning how to use Linux and UNIX system utilities, first carefully study the differences between filename pattern matching, basic regular expressions, and extended regular expressions and learn how to write patterns, BREs, and EREs to match whatever you might want to match. (Then you'll immediately know what type of expression you need to use for a particular type of string match.) Then study the man pages for the utilities you want to use. Everything you needed for this job comes from knowing BREs and from the address ranges section of the sed man page.
And, finally, practice makes perfect. Play around with various problems until the solutions to them just flow from your fingertips. Read the problems posed here; look at the suggestions provided; if they don't make sense to you, read the man pages; if they still don't make sense, ask questions!
The BRE and ERE [:space:] is a bracket expression that will match any one of the characters "a", "c", "e", "p", "s", and ":". While [[:space:]] is a bracket expression that will match any character in the space character class. (In the C and POSIX locales, the space character class includes the <space>, <form-feed>, <newline>, <carriagereturn>, <tab>, and <vertical-tab> characters.)
And BRE and ERE [^[:lower:][:digit:]] is a non-matching bracket expression that will match any character that is not a lowercase alphabetic character and is not a decimal digit in the current locale.