How to extract a string from a file ignoring new line

Hi,
sumdays before i had posted a query with same subject.

i got sum great help from great ppl which solved my problem then.
But now there is a small problem with the code that i need the experts help upon.

for parsing a text

like this

where $ had been the delimiter between messages.

i have used the following piece of code

 
tr "\n" " " < file | tr "$" "\n" > output

Now there is a problem that this $ delimiter also occurs as a part of text like this

as a result i am getting the output like this

i want the parsed message to be in the format mentioned above, i.e, i want the $ sign to be considered only if it is between messages (like this
} $ { ) and to be left with the text untouched if it is inside the message text.
Will be very grateful if sum1 can provide a solution.

wanted output :

try.

tr "\n" " " < file | sed 's| \$ |\n|g'

or

echo $(cat file) | sed 's| \$ |\n|g'

To remove $ :

sed '/^\$$/d' yourfile

I dont want to remove all $. i want to replace $ sign which appears as a delimiter with a newline.i want the $ signs which appear as part of the message to appear as it is.
i tried using this code

tr "\n" " " < file | sed 's| \$ |\n|g'
echo $(cat file) | sed 's| \$ |\n|g'

Both threw this message

and also in the output it removed all occurences of $ instead of removing only the ones that appear as delimiter.
Please help me with a code that meets the above requirement. Im a unix novice and im totally confused how to do this.