csv import problem

This topic contains 4 replies, has 2 voices, and was last updated by  Stephen Harris 10 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #13240

    Hi,
    I have a csv file export from the website.
    When i expand this file the import wont work.

    i gret the next messeage:
    Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in /home/eenvoud/public_html/oplsshop.eenvoudiguwwebsite.nl/wp-content/plugins/event-organiser-csv/includes/class-eo-csv-parser.php on line 117

    Warning: Invalid argument supplied for foreach() in /home/eenvoud/public_html/oplsshop.eenvoudiguwwebsite.nl/wp-content/plugins/event-organiser-csv/includes/class-eo-csv-parser.php on line 138

    Do you have any idea what this is?

    Thanks for the information

    regards,

    Jeroen

    Jeroen Janssen
    #13245

    I now try to import without the first line.
    This went for 75% well.

    I want to use a short code in the content.
    example: [button link=”/shop/test-test/arnhem-test/”]Inschrijven[/button]
    The ” ” makes that the shortcode dos not work.

    When i last upload a excel every things works…..
    Is there something change?

    regards,

    Jeroen

    Jeroen Janssen
    #13251

    Hi Jeroen

    That error message would occur if the number of columns in the first line (which is the “header” row) doesn’t match the number of columns of subsequent rows. The plug-in automatically ‘slices’ off excess columns of a row, so in this case it would seem the problem is that a row doesn’t contain enough columns.

    An obvious and easy to solution would be to pad the columns if required, which I’ll do in an update.

    For an immediate fix it should be enough to ensure that each line of your CSV files has enough delimiters. Specifically instead of

     A, B, C, D, E
     A, B
     A, B, C, D, E

    you would have

     A, B, C, D, E
     A, B,,,
     A, B, C, D, E

    I’ll look into the issue regarding the shortcode.

    Stephen Harris
    #13301

    That would be great . (shortcode)
    in the mean time I will test the other thing.

    Jeroen Janssen
    #13306

    Hi Jeroen,

    Since " are used to separate fields I found it necessary to do the following:

    "A","B","C","[button link=""/shop/test-test/arnhem-test/""]Inschrijven[/button]","D","E"

    That is enclosing each value in double quotes, and preceding each double quote in the value with a double quote. This is the format the plug-in should be exporting CSV files and is the “correct” format (though CSV is very loosely defined).

    The ‘example’ CSV file included with the plug-in doesn’t include this format since it doesn’t contain any double quotes, but perhaps it should be updated to reflect this case.

    Stephen Harris
Viewing 5 posts - 1 through 5 (of 5 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.