wireservice / csvkit

A suite of utilities for converting to and working with CSV, the king of tabular file formats.
https://csvkit.readthedocs.io
MIT License
6.03k stars 603 forks source link

Replace slash "/" by a more sql friendly character? #1154

Closed mardub1635 closed 2 years ago

mardub1635 commented 2 years ago

Hi, when using in2csv to generate csv from json files, the default behaviour is to use slash "/" to make subcategories: Below an example of name in a csv generated by in2csv: author/avatar | author/name | id | numReplies

Now if I want to use csvsql to get "author/name" I get an error message image

sql does not like slashes "/" in name field...

It took me a while to figure out how to escape "/" in sql. One can indeed use [author/name] and then it will work. So can we apply any of the following fixe:

jpmckinney commented 2 years ago

I've added an example to the documentation. Changing the column naming now would break a lot of data pipelines.