Browse Source

tools/ucd.py: support printing out the data as CSV with specified columns from the command-line

master
Reece H. Dunn 12 years ago
parent
commit
88e72aeb0a
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      tools/ucd.py

+ 8
- 1
tools/ucd.py View File

@@ -182,5 +182,12 @@ def parse_ucd_data(ucd_rootdir, dataset):
yield data

if __name__ == '__main__':
try:
items = sys.argv[3].split(',')
except:
items = None
for entry in parse_ucd_data(sys.argv[1], sys.argv[2]):
print entry
if items:
print ','.join([str(entry[item]) for item in items])
else:
print entry

Loading…
Cancel
Save