Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2b2795ac
Commit
2b2795ac
authored
Jul 08, 2004
by
Skip Montanaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show how easy it is to manipulate individual columns - from a request on
c.l.py
parent
1dffb120
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
Doc/lib/libcsv.tex
Doc/lib/libcsv.tex
+9
-0
No files found.
Doc/lib/libcsv.tex
View file @
2b2795ac
...
...
@@ -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}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment