WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

about "Invalid parameter for CSV import: Fields enclosed by"

View: New views
4 Messages — Rating Filter:   Alert me  

about "Invalid parameter for CSV import: Fields enclosed by"

by Marc Delisle :: Rate this Message:

| View Threaded | Show Only this Message

Hi,
we got a few requests about this. Probably the most common generator of
CSV files is MS Excel, and this fine application, when saving as CSV,
generates a semi-colon separated file with no possibility of specifying
the enclosing character (at least in the default dialog, I did not dig
everywhere).

But phpMyAdmin refuses to import it (see subject). I deactivated the
message in my copy of PMA then imported some simple sample data

Marc;1
Luc;2

(removing the double quotes in the CSV dialog), it went fine so I am
tempted to get rid of this validation but would like to hear your comments.

Marc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Phpmyadmin-devel mailing list
Phpmyadmin-devel@...
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel

Re: about "Invalid parameter for CSV import: Fields enclosed by"

by Michal Čihař :: Rate this Message:

| View Threaded | Show Only this Message

Hi

On Mon, 21 Jan 2008 16:34:40 -0500
Marc Delisle <Marc.Delisle@...> wrote:

> we got a few requests about this. Probably the most common generator of
> CSV files is MS Excel, and this fine application, when saving as CSV,
> generates a semi-colon separated file with no possibility of specifying
> the enclosing character (at least in the default dialog, I did not dig
> everywhere).
>
> But phpMyAdmin refuses to import it (see subject). I deactivated the
> message in my copy of PMA then imported some simple sample data

What about leaving enclosed by to quote? It should work.

> (removing the double quotes in the CSV dialog), it went fine so I am
> tempted to get rid of this validation but would like to hear your comments.

I'm not sure what exactly happens in parser when this field is empty.

--
        Michal Čihař | http://cihar.com | http://blog.cihar.com


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Phpmyadmin-devel mailing list
Phpmyadmin-devel@...
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel

signature.asc (196 bytes) Download Attachment

Re: about "Invalid parameter for CSV import:

by Marc Delisle :: Rate this Message:

| View Threaded | Show Only this Message

Michal Čihař a écrit :

> Hi
>
> On Mon, 21 Jan 2008 16:34:40 -0500
> Marc Delisle <Marc.Delisle@...> wrote:
>
>> we got a few requests about this. Probably the most common generator of
>> CSV files is MS Excel, and this fine application, when saving as CSV,
>> generates a semi-colon separated file with no possibility of specifying
>> the enclosing character (at least in the default dialog, I did not dig
>> everywhere).
>>
>> But phpMyAdmin refuses to import it (see subject). I deactivated the
>> message in my copy of PMA then imported some simple sample data
>
> What about leaving enclosed by to quote? It should work.

Yes it works, however users tend to remove it because their file does
not have an enclosing character.

>
>> (removing the double quotes in the CSV dialog), it went fine so I am
>> tempted to get rid of this validation but would like to hear your comments.
>
> I'm not sure what exactly happens in parser when this field is empty.

I tested with a couple tables and could not produce any error when
leaving it empty. I suggest to deactivate the message for 2.11.5.

Marc



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Phpmyadmin-devel mailing list
Phpmyadmin-devel@...
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel

Re: about "Invalid parameter for CSV import: Fields enclosed by"

by zedzdead :: Rate this Message:

| View Threaded | Show Only this Message

Marc Delisle wrote:
(removing the double quotes in the CSV dialog), it went fine so I am
tempted to get rid of this validation but would like to hear your comments.

Marc
Removing the double quotes is vital for Excel generated CSVs since some imported fields might contain html.  HTML attributes within tags are enclosed with quotes, and the import sees these as field enclosing characters and appears to generated field count errors when left in.  

I'm glad I found this post, because I've been going round in circles with this. at least I know I'm not going to get this to work using the import, until the Fields Enclosed by field can be made optional.

I'm going to write a chunck of PHP to do this for now, but I'd love a simple import to handle the Excel generated CSVs