Skip to content
Snippets Groups Projects
Commit baf1f3ab authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

use read.fieldnames to get key

parent 35c71798
No related branches found
No related tags found
No related merge requests found
......@@ -21,9 +21,11 @@ class Roscop:
print("Code roscop file: %s" % self.file)
with open(self.file, 'rt') as f:
reader = csv.DictReader(f, delimiter=';')
print(reader.fieldnames)
for row in reader:
print("%s : %s : %s : %s : %s" % (row['key'], row['long_name'],
row['standard_name'], row['units'], row['format']))
for key in reader.fieldnames:
print("%s:" % row[key], end='')
print()
return
# for testing in standalone context
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment