show how easy it is to manipulate individual columns - from a request on

c.l.py
This commit is contained in:
Skip Montanaro 2004-07-08 19:49:10 +00:00
parent 1dffb120b7
commit 2b2795ac6d

View file

@ -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}