Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
uahil
CPUnetPLOT
Commits
130564a3
Commit
130564a3
authored
Aug 08, 2014
by
Mario Hock
Browse files
csv.reader and csv.DictReader
Also, skipinitialspace=True.
parent
72b65a20
Changes
1
Hide whitespace changes
Inline
Side-by-side
simple_plotter.py
View file @
130564a3
...
...
@@ -59,11 +59,22 @@ if __name__ == "__main__":
header
=
read_header
(
in_file
)
print
(
json
.
dumps
(
header
,
sort_keys
=
True
,
indent
=
4
)
)
## XXX
## XXX
print
(
"///"
)
print
()
for
l
in
csv
.
reader
(
cnl_slice
(
in_file
,
"%% Begin_Body"
,
"%% End_Body"
)
):
## Read as lists
#csv_reader = csv.reader( cnl_slice(in_file, "%% Begin_Body", "%% End_Body"), skipinitialspace=True )
#csv_header = next(csv_reader)
#print( csv_header )
## Read as dicts
csv_reader
=
csv
.
DictReader
(
cnl_slice
(
in_file
,
"%% Begin_Body"
,
"%% End_Body"
),
skipinitialspace
=
True
)
## print
for
l
in
csv_reader
:
print
(
l
)
#print( l["eth0.send"] + ", " + l["eth0.receive"] )
pass
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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