[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: Software that will populate a database from csv data?



On Fri, Jul 22, 2011 at 6:42 PM, Darac Marjal <mailinglist@darac.org.uk> wrote:
> On Fri, Jul 22, 2011 at 04:44:53PM +0300, George wrote:
>> I'm looking for software that will accept as input a csv file and a database
>> schema and will populate the database with the data in the csv. I'm not talking
>> about something simple that will fill a single table, but rather something that
>> can work foreign key constraints and can respect one-to-many, many-to-one and
>> many-to-many relations.
>
> You haven't told us which database software you're using (CSV is a kind
> of database, but I'll ignore the trivial cp), so I'll assume mysql.
>
> $ mysqlimport --fields-terminated-by=\, --fields-enclosed-by=\" MyDatabase
> MyBackup.csv

But that only works for a single table, please re-read my original post.


Reply to: