From 2b2795ac6d20ad9171eb083a9e3bcf8eeaa4a889 Mon Sep 17 00:00:00 2001 From: Skip Montanaro Date: Thu, 8 Jul 2004 19:49:10 +0000 Subject: show how easy it is to manipulate individual columns - from a request on c.l.py --- Doc/lib/libcsv.tex | 9 +++++++++ 1 file changed, 9 insertions(+) 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} -- cgit v0.12