summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/lib/libcsv.tex9
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/lib/libcsv.tex b/Doc/lib/libcsv.tex
index f2dc912..5486cf1 100644
--- a/Doc/lib/libcsv.tex
+++ b/Doc/lib/libcsv.tex
@@ -319,6 +319,15 @@ for row in reader:
print row
\end{verbatim}
+To print just the first and last columns of each row try
+
+\begin{verbatim}
+import csv
+reader = csv.reader(file("some.csv", "rb"))
+for row in reader:
+ print row[0], row[-1]
+\end{verbatim}
+
The corresponding simplest possible writing example is
\begin{verbatim}