FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
code_snippets/Python-CSV/parse_csv.py at master · dancebean/code_snippets · GitHub
dancebean
/
code_snippets
Public
forked from
CoreyMSchafer/code_snippets
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
code_snippets
/
Python-CSV
/
parse_csv.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
15 lines (10 loc) · 415 Bytes
Breadcrumbs
code_snippets
/
Python-CSV
/
parse_csv.py
Copy path
File metadata and controls
15 lines (10 loc) · 415 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import
csv
with
open
(
'names.csv'
,
'r'
)
as
csv_file
:
csv_reader
=
csv
.
DictReader
(
csv_file
)
with
open
(
'new_names.csv'
,
'w'
)
as
new_file
:
fieldnames
=
[
'first_name'
,
'last_name'
]
csv_writer
=
csv
.
DictWriter
(
new_file
,
fieldnames
=
fieldnames
,
delimiter
=
'
\t
'
)
csv_writer
.
writeheader
()
for
line
in
csv_reader
:
del
line
[
'email'
]
csv_writer
.
writerow
(
line
)
Back
|
FazBrowse Home
|
New Git URL