You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The second example using clojure-csv.core is correct. The columns are in the wrong order in the first example.
The source CSV looks like this:
"R1A","WORCESTERSHIRE HEALTH AND CARE NHS TRUST","Y55","Q77","ISAAC MADDOX HOUSE","SHRUB HILL INDUSTRIAL ESTATE","","WORCESTER","WORCESTERSHIRE","WR4 9RW","20110701","","","","","","","","","","","0","","F","","",""
"R1C","SOLENT NHS TRUST","Y57","Q70","SOLENT NHS TRUST HEADQUARTERS","HIGHPOINT VENUE","BURSLEDON ROAD","SOUTHAMPTON","HAMPSHIRE","SO19 8BR","20110401","","","","","","","","","","","0","","J","","",""
"R1D","SHROPSHIRE COMMUNITY HEALTH NHS TRUST","Y55","Q76","WILLIAM FARR HOUSE","MYTTON OAK ROAD","","SHREWSBURY","SHROPSHIRE","SY3 8XL","20110701","","","","","","","","","","","0","","E","","",""
The text was updated successfully, but these errors were encountered:
As per the doc, csv-map uses the first line of the csv file as column headers; i.e. the first row is turned into map keys and subsequent rows are turned into map values.
As far as I can see, csv-map performed as expected over the source CSV above i.e. it interpreted the first row as header / map keys.
The outputs of clojure-csv and csv-map are supposed to be different; clojure-csv returns a list of vecs whereas csv-map returns a list of maps, hence the difference you've observed.
The second example using
clojure-csv.core
is correct. The columns are in the wrong order in the first example.The source CSV looks like this:
The text was updated successfully, but these errors were encountered: