{"action":"opened","issue":{"url":"https://api.github.com/repos/onyxfish/csvkit/issues/434","labels_url":"https://api.github.com/repos/onyxfish/csvkit/issues/434/labels{/name}","comments_url":"https://api.github.com/repos/onyxfish/csvkit/issues/434/comments","events_url":"https://api.github.com/repos/onyxfish/csvkit/issues/434/events","html_url":"https://github.com/onyxfish/csvkit/issues/434","id":99511234,"number":434,"title":"Spaces in headers handled inconsistently","user":{"login":"cmbirk","id":764851,"avatar_url":"https://avatars.githubusercontent.com/u/764851?v=3","gravatar_id":"","url":"https://api.github.com/users/cmbirk","html_url":"https://github.com/cmbirk","followers_url":"https://api.github.com/users/cmbirk/followers","following_url":"https://api.github.com/users/cmbirk/following{/other_user}","gists_url":"https://api.github.com/users/cmbirk/gists{/gist_id}","starred_url":"https://api.github.com/users/cmbirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmbirk/subscriptions","organizations_url":"https://api.github.com/users/cmbirk/orgs","repos_url":"https://api.github.com/users/cmbirk/repos","events_url":"https://api.github.com/users/cmbirk/events{/privacy}","received_events_url":"https://api.github.com/users/cmbirk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-06T19:52:15Z","updated_at":"2015-08-06T19:52:15Z","closed_at":null,"body":"It looks like spaces in the headers line are causing problems in some places but not others. \r\n\r\nHere's the first line of my csv file:\r\n\r\n```\r\nRecord #,Type,Status,Intro Date,Final Action,Main Sponsor's Ward/Office,Title\r\n```\r\n\r\nrunning `csvcut -n example.csv` returns \r\n\r\n```\r\n1: Record #\r\n2: Type\r\n3: Status\r\n4: Intro Date\r\n5: Final Action\r\n6: Main Sponsor's Ward/Office\r\n7: Title\r\n```\r\n\r\n**which is obviously correct**, but running `csvsql -i mysql example.csv` returns\r\n\r\n```\r\nCREATE TABLE council_clean (\r\n\t`Record` VARCHAR(66) NOT NULL, \r\n\t`#,Type,Status,Intro Date,Final Action,Main` VARCHAR(17) NOT NULL, \r\n\t`Sponsor's` VARCHAR(35) NOT NULL, \r\n\t`Ward/Office,Title` VARCHAR(14)\r\n);\r\n```\r\n\r\nand `csvstat example.csv` returns\r\n\r\n```\r\n1. Record\r\n\t<type 'unicode'>\r\n\tNulls: False\r\n\tUnique values: 1420\r\n\tMax length: 66\r\n  2. #,Type,Status,Intro Date,Final Action,Main\r\n\t<type 'unicode'>\r\n\tNulls: False\r\n\tUnique values: 37\r\n\t5 most frequent values:\r\n\t\tof:\t510\r\n\t\tto:\t269\r\n\t\tParking:\t177\r\n\t\tfor:\t127\r\n\t\tReclassification:\t57\r\n\tMax length: 17\r\n  3. Sponsor's\r\n\t<type 'unicode'>\r\n\tNulls: False\r\n\tUnique values: 192\r\n\t5 most frequent values:\r\n\t\tprivilege:\t314\r\n\t\tvehicle:\t188\r\n\t\tPermit:\t176\r\n\t\tat:\t78\r\n\t\tlate:\t57\r\n\tMax length: 35\r\n  4. Ward/Office,Title\r\n\t<type 'unicode'>\r\n\tNulls: True\r\n\tUnique values: 316\r\n\t5 most frequent values:\r\n\t\tin:\t314\r\n\t\tNo.:\t258\r\n\t\tclaim:\t211\r\n\t\tfor:\t55\r\n\t\tCode:\t33\r\n\tMax length: 14\r\n```\r\n\r\nSome of the spaces are used correctly, but the space in the first and sixth column seem to be causing issues.  Any thoughts on why this would be?"}}