Re: CSV-to-SQL?
On Friday 08 April 2005 06:14, Richard Miller wrote: > I didn't know the CSV table-type existed -- sounds really cool! > > As I understand it, it will save table data in a flat CSV file, but if > I already have a CSV file, can I trick MySQL into thinking it's a > table? That wasn't clear from the documentation. Hi Richard, never tryied but if you have a good CSV file and create the table manually, stop the server, copy your CSV to the one mysql created and start the server back, it should work fine... worth a shot! ;) --rengolin -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: CSV-to-SQL?
I didn't know the CSV table-type existed -- sounds really cool! As I understand it, it will save table data in a flat CSV file, but if I already have a CSV file, can I trick MySQL into thinking it's a table? That wasn't clear from the documentation. Richard On Apr 5, 2005, at 7:47 PM, Renato Golin wrote: You could use the CSV table type: http://dev.mysql.com/doc/mysql/en/csv-storage-engine.html Or use the LOAD DATA INFILE to import all data: http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html --rengolin --- Richard Miller <[EMAIL PROTECTED]> wrote: I have a dozen, very large CSV files that I would like to put into a MySQL database, with 1 table per file. Does anyone know of a PHP (or other) script that can read the first few lines of a CSV file and create an appropriate CREATE TABLE statement based on the data it finds? (Even better, it could import the file afterwards!) I'm not picky about data types here; I'd simply like to get this data into tables so I can work with it more easily. Thanks, Richard Miller -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! http://br.acesso.yahoo.com/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: CSV-to-SQL?
Maybe a review of http://dev.mysql.com/doc/mysql/en/numeric-type-overview.html will shed some light? -Original Message- From: Renato Golin [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 05, 2005 9:48 PM To: Richard Miller; Mysql Subject: Re: CSV-to-SQL? You could use the CSV table type: http://dev.mysql.com/doc/mysql/en/csv-storage-engine.html Or use the LOAD DATA INFILE to import all data: http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html --rengolin --- Richard Miller <[EMAIL PROTECTED]> wrote: > I have a dozen, very large CSV files that I would > like to put into a > MySQL database, with 1 table per file. Does anyone > know of a PHP (or > other) script that can read the first few lines of a > CSV file and > create an appropriate CREATE TABLE statement based > on the data it > finds? (Even better, it could import the file > afterwards!) I'm not > picky about data types here; I'd simply like to get > this data into > tables so I can work with it more easily. > > Thanks, > Richard Miller > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > > Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! http://br.acesso.yahoo.com/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: CSV-to-SQL?
You could use the CSV table type: http://dev.mysql.com/doc/mysql/en/csv-storage-engine.html Or use the LOAD DATA INFILE to import all data: http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html --rengolin --- Richard Miller <[EMAIL PROTECTED]> wrote: > I have a dozen, very large CSV files that I would > like to put into a > MySQL database, with 1 table per file. Does anyone > know of a PHP (or > other) script that can read the first few lines of a > CSV file and > create an appropriate CREATE TABLE statement based > on the data it > finds? (Even better, it could import the file > afterwards!) I'm not > picky about data types here; I'd simply like to get > this data into > tables so I can work with it more easily. > > Thanks, > Richard Miller > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > > Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! http://br.acesso.yahoo.com/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]