Save your excel file as CSV, and run the following command:

mysqlimport --fields-optionally-enclosed-by="""
--fields-terminated-by=, --lines-terminated-by="\r\n"
--user=YOUR_USERNAME --password YOUR_DATABASE YOUR_TABLE.csv

Make sure not to include the headers of your excel columns and to set
up your table beforehand. Don't forget to replace all necessary parts
in the command above.

If you're not on Windows you should probably use \n instead of \r\n
for the newline character.

On Fri, Sep 5, 2008 at 1:12 PM, Nasreen Laghari
<[EMAIL PROTECTED]> wrote:
> Hi Evert,
>
> I have attached it again.
>
>
> Regards,
>
> Nasreen
>
> ----- Original Message ----
> From: Evert Lammerts <[EMAIL PROTECTED]>
> To: Nasreen Laghari <[EMAIL PROTECTED]>
> Sent: Friday, September 5, 2008 11:03:18 AM
> Subject: Re: [PHP-DB] Import Excel sheet into SQL
>
> Attachment didn't make it
>
> On Fri, Sep 5, 2008 at 12:00 PM, Nasreen Laghari
> <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>>
>>
>> How can I import Excel sheet into MS-SQL. The data I have saved in excel
>> sheet is in cells, snapshot is attached in this email.
>>
>>
>>
>> I am using sqlmyAdmin. and tried using import but getting error "Invalid
>> Count on line1"
>>
>>
>>
>>
>>
>>
>>
>> Help required!!!
>>
>>
>>
>>
>>
>> Nasreen
>>
>>
>>
>>
>>
>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to