• Hi. I’m new to this plugin, but it looks first class. Having customized it, it does pretty much what I want it to. Awesome. But I’m having trouble uploading a csv file. The file is a large one, with 1900 records. The upload fails with the message:
    “The file newbiblio4.csv has been uploaded.
    The number of items in line 7 is incorrect.
    There are 17 and there should be 15.
    6 records added”
    But when the file is limited to the first 30 records (ie including line 7), it uploads correctly. Any advice?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author xnau webdesign

    (@xnau)

    This means there is a syntax error in your CSV file. It’s a matter of finding it and fixing it, although that can be a bit of a puzzle.

    An error message like that indicates that there are commas in the unenclosed data for a field in the 7th record. (Unenclosed means that the data is not enclosed in quotes.) The solution is to make sure all data that contains commas is enclosed. This is normally done automatically by the app that is producing the CSV. You may need to edit it manually to fix the problem, or look at the settings of the app to get a better CSV export or even use a different method for producing the CSV.

    You also may need to look at the syntax of the CSV in general…for example if the data contains double quotes, you will need to use single quote as your enclosure, but that will usually cause problems with apostrophes in the data.

    If the CSV data contains both double quotes and single quotes/apostrophes, then you need to get creative and replace the double quotes with HTML entities like " then use double quote as your enclosure.

    Why it works when the file is shortened, I can’t say, but it’s always best to solve the first problem first, then address the second problem if it persists after solving the first.

    Thread Starter rogerpearce

    (@rogerpearce)

    Many thanks. And thanks for the swift response. I’ll have to get creative and replace all the quotation marks, commas etc in the csv file with HTML codes, then try again.

    Thread Starter rogerpearce

    (@rogerpearce)

    I meant the source file. Replacing the commas in the csv file wuld be a bit counter-productive!

    Thread Starter rogerpearce

    (@rogerpearce)

    Hooray. That works (mostly). Can you advise as to the likely cause of
    “x records skipped due to errors”? Many thanks again.

    Plugin Author xnau webdesign

    (@xnau)

    This can mean that you have the record matching set up to throw an error (Don’t Import) if a duplicate is encountered. Check the import preferences for that.

    If that does not explain what you’re seeing, you should enable plugin debugging (this is in the plugin settings under the advanced tab) then open the debugging log. Clear it, then perform the import. It will show each record as a separate entry, so that will generate a lot of irrelevant messages. In there, though, should be some detail about the errors that were encountered.

    Thread Starter rogerpearce

    (@rogerpearce)

    Hi. Many thanks again for rapid and helpful reply. I isolated two records which are consistently failing in the csv upload. I ran an import file containing just those two records. There are two entries in the log saying:
    [02/26/21 9:54am UTC]
    Participants_Db::process_form storing record:
    [02/26/21 9:54am UTC]
    but no other clues as to the error.

    The log also has numerous other entries which suggest there’s a conflict with the rest of the site, for example:
    [02/26/21 9:54am UTC]
    Function create_function() is deprecated
    in /var/www/public_html/wp-content/plugins/srs/srs.php on line 38

    and

    Non-static method OLWPT_FEAT_Factory::addType() should not be called statically
    in /var/www/public_html/wp-content/themes/ol-wp-theme/com/feature/cls/OLWPT_Feature.php on line 282

    and

    [02/26/21 9:54am UTC]
    Declaration of SRS_wtax::get_info($book, $item) should be compatible with SRS_olb::get_info($book, $item = NULL)
    in /var/www/public_html/wp-content/plugins/srs/cls/SRS_olb.php on line 971

    There are lots of these entries. But this doesn’t explain why it’s just these two records which are consistently failing. (For the record, I can create both of them manually).

    I’m at the limit of my understanding here. Am I right that it’s a conflict? Should I follow this up with my site host?

    Best wishes

    Plugin Author xnau webdesign

    (@xnau)

    Nothing there is directly related to the CSV import, but it does look like you have a misbehaving plugin tyhat should be updated or replaced with a more current plugin. It’s the plugin that is loaded at plugins/srs that is causing problems, looks like a poorly coded or outdated plugin.

    If you have certain records that are failing to import, you can look at the data for those records for something that might cause problems, but since there is nothing specific about that problem in the log, you won’t know exactly what you are looking for.

    As long as the syntax of the CSV is correct, there isn’t any specific content that cannot be imported, so I can’t tell you what to look for. If you trim the CSV down to just the records that are failing, it may be easier to see what the issue is in the log.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘CSV upload problem: large file’ is closed to new replies.