For example, I'm working on a database project where I'd like to do lots of emacs regex to get a file of comma delimited lines turned into sql INSERT-ready statements. Here's what the VALUES of my INSERT look like:
(UPPER (SUBSTRING(MD5(RAND()) FROM 1 FOR 6)), ,'P',1)
the first part up until ...FOR 6)) is just a six-place hex id generator (mysql syntax) for the record, then comes an empty field, then 'P' etc. So I'm looking to shove a chunk of text from my comma delimited file into the empty field. e.g.,
(...FROM 1 FOR 6)),'new thing 1','P',1)
where 'new thing 1' came from a line in the comma delim file. Right, so I can do this with Emacs' regex in a one-off tunneling sort of way, but how could I do this inside an org-mode file? I'm guessing I would need to use elisp (perl, lisp, etc) in a literate way, i.e., my org-mode file would have code sections and results sections. But could the results of running literate code then be fed into the next section of literate code? I need to run code on data, get results, run more code on that -- all while interactively composing my org-mode file. Is this possible?
Basically, I'm looking for something better than the typical Emacs REPL session where you have the option of simply saving the entire session's REPL buffer. But I don't want it to be so cumbersome that I'm writing a tutorial, either -- even though that's what I'm sort of doing. The dream would be that a whole day's work could be contained in org-mode files -- both the code and the description of what's going on and how things came (in)to be(ing).