Reverse Instructional Design --- csvkit

Aug 13, 2014 • David Kua

These questions pertain to the CSV toolkit http://csvkit.readthedocs.org/.


You will be working with an open dataset from the City of Toronto containing the number marriage registrations that occurred per month at different civic centres. The data looks like the following:

“TIME_PERIOD”,”CIVIC_CENTRE”,”MARRIAGE_LICENSES”
“2011-01″,”ET”,80
“2011-01″,”NY”,136
“2011-01″,”SC”,159
“2011-01″,”TO”,367
“2011-02″,”ET”,109
“2011-02″,”NY”,150
“2011-02″,”SC”,154
“2011-02″,”TO”,383
“2011-03″,”ET”,177
“2011-03″,”NY”,231
“2011-03″,”SC”,213
“2011-03″,”TO”,589
“2011-04″,”ET”,178
“2011-04″,”NY”,277
“2011-04″,”SC”,261
“2011-04″,”TO”,660
“2011-05″,”ET”,263
“2011-05″,”NY”,376
“2011-05″,”SC”,375
“2011-05″,”TO”,871
“2011-06″,”ET”,255

Question 1

What command would you use to list out the fields of the above CSV file?

  1. csvlook -f [file]
  2. csvcut -r 1 [file]
  3. csvcut -n [file]
  4. csvlook [file]
  5. csvlook -h [file]

Question 2

What command(s) would you use to create a csv file named “ny_marriage.csv” that contains only the lines pertaining to the civic centre “NY”?