8

Are there any command line tools (Linux, Mac, and/or Windows) that I could use to scan a delimited file and output a DDL create table statement with the data type determined for me?

Did some googling, but couldn't find anything. Was wondering if others might know, thanks!

TT.
  • 15,774
  • 6
  • 47
  • 88
Vinh Nguyen
  • 1,014
  • 1
  • 9
  • 19

3 Answers3

5

DDL-generator can do this. It can generate DDL's for YAML, JSON, CSV, Pickle and HTML (although I don't know how the last one works). I just tried it on some data exported from Salesforce and it worked pretty well. Note you need to use it with Python 3, I could not get it to work with Python 2.7.

Mark Butler
  • 4,361
  • 2
  • 39
  • 39
1

You can also try https://github.com/mshanu/idli. It can take csv file as input and can generate create statement with appropriate types.It can generate for mysql, oracle and postgres. I am actively working on this and happy to receive feedback for future improvement

Shanu M
  • 11
  • 2
0

Recently I tried this online tool convertcsv.com/csv-to-sql. I did some adjustments but it helped me a lot!

S.B
  • 13,077
  • 10
  • 22
  • 49
maihe
  • 43
  • 8