I have a program that can send text to any other program for further analysis (eg sed, grep, etc). I would like it to send the data to Emacs and do analysis there. How would I
This does what you ask for:
emacsclient -e '(open-buffer-with "some\nstuff\nhere")'
(defun open-buffer-with (txt)
"create a new buffer, insert txt"
(pop-to-buffer (get-buffer-create (generate-new-buffer-name "something")))
(insert txt))
Obviously you can customize open-buffer-with to do what you want.
There's a similar question you might want to look at: How do I get basic App<->Emacs integration?.