Thanks for the quick response!
At first I was going to answer that it wasn't possible to includeOn Wed, Dec 14, 2011 at 13:54, Justin Haynes <firstname.lastname@example.org> wrote:
> So first off, I am way new to docutils! I'm using sphinx to generate a
> document but I want to include data from csvs inline.
> For example:
> i want to read data from a file called surveyed.csv into a sentence that
> The number of people surveyed was ___ .
> where the blank is the number contained in the first column of the second
> row of the csv. if necessary, the csv can be output as a single number with
> no header or extra columns.
> I'm sure this is easy, but I'm at a loss!!
external text inline. But then I thought of a way that might work, and
was pleasantly surprised when it did work. It's a bit convoluted, so
it's not surprising that you weren't able to figure out how. We'll use
the "include" directive _ in conjunction with a substitution
definition _ using "replace" _.
..  "include" directive:
..  substitution definitions:
..  "replace" directive:
There's no way for "include" to extract a specific column from a CSV
file. You can specify a range of lines to include, and there are other
options (see _). So you'll probably have to adjust your input
Assuming that the value to include is in a file called
"number-surveyed.txt", here's how to do it in your document:
.. |surveyed| replace::
.. include:: number-surveyed.txt
The number of people surveyed was |surveyed|.
David Goodger <http://python.net/~goodger>