Best practices for importing large CSV files

前端 未结 10 870
攒了一身酷
攒了一身酷 2020-12-14 16:39

My company gets a set of CSV files full of bank account info each month that I need to import into a database. Some of these files can be pretty big. For example, one is abo

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-14 17:16

    I need to do this too from time to time (import large non-standardized CSVs where each row creates a dozen or so related DB objects) so I wrote a python script where I can specify what goes where and how it's all related. The script then simply generates INSERT statements.

    Here it is: csv2db

    Disclaimer: I'm basically a noob when it comes to databases, so there might be better ways to accomplish this.

提交回复
热议问题