• hi,
    I’m getting error while importing csv file having Apostrophe ( ‘ ) symbol in content

    Could not insert post into the database
    WP_Post object is not set.
    WP_Post object is not set.
    WP_Post object is not set.
    WP_Post object is not set.
    WP_Post object is not set.
    WP_Post object is not set.
    WP_Post object is not set.
    WP_Post object is not set.
    WP_Post object is not set.
    WP_Post object is not set.

    I’m using following column names

    post_title
    pages(ACF)
    single_user_price(ACF)
    enterprise_price(ACF)
    published_date (ACF)
    post_content
    table_of_contents(ACF)
    tax_report_category(taxonomy)
    post_type
    status

    Thanks in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Takuro Hishikawa

    (@hissy)

    Did you quote all cells with double quotes?

    Thread Starter snehabarve

    (@snehabarve)

    yes all cells are quoted with double quotes…

    @snehabarve

    Hi! Thanks for writing.

    I did a test trying to re-create this. Made custom fields with the names specified, and custom taxonomy with the name specified.

    Made a sample .csv file to import as specified, like this:

    "post_title","pages","single_user_price","enterprise_price","published_date","post_content","table_of_contents","tax_report_category","post_type","status"
    "Import test 3",,"100","200","Apple, Banana","Doll‘s clothes","2014-06-06","#ff0099","post","A"

    To try and reproduce the error, i tried two types of apostrophe — the and the '.

    So far, the tests haven’t been able to reproduce the “…object is not set…” message. So far the tests have resulted in having successful import of the data as a post.

    I wonder what it could be?

    Can you make your .csv file (from your symptomatic run) available to us for testing, so I can be better able to reproduce the symptom?

    (or even a sample .csv file if you have one, for example a simple one with one line, that manifests the same symptom)

    Thread Starter snehabarve

    (@snehabarve)

    hi,

    If you share your email ID I will send you my CSV so that you can check it, because it’s quite big.(Single column contains many paragraphs.) Or else you tell me how to share it.

    Thanks in advance.

    @snehabarve

    Will you paste the contents (plain text) of the csv file to pastebin.com (or other public repository) and then share the link here?

    (Assuming it’s not sensitive information)

    (Sharing via private email is generally frowned upon in this w.org community)

    If you know of a subset of the data that is still symptomatic maybe that would be more convenient than sharing the whole file… But if not then go for it!

    Or if not pastebin then do you have a repository like Dropbox or google docs? Via which you could share the file ?

    If these options don’t work, please write me back– we’ll think of some way to get it shared properly!

    Thread Starter snehabarve

    (@snehabarve)

    @mjjojo (mjassen)

    I can share it with dropbox.
    here is the link for the same https://www.dropbox.com/s/3crkrx18aqou5tc/book1.csv?dl=0

    Thanks in advance.

    @snehabarve

    Thank you for sharing the file. I tried it in test environment and was getting similar errors.

    I saw there were 20 errors, but 21 lines in the file. Speculated that one line might be symptomatic.

    Looking at the book1.csv file in plain text editor saw the first line (the header line) did not have quotes — speculate that might be related to the symptom?

    To try and add quote marks to the header row, I opened the file in LibreOffice. It opened ok. Then I re-saved it freshly as book2.csv, this time enabling these options:
    set Field delimiter = (comma)(this is default)
    set Text delimiter = (double-quote mark)(this is default)
    enable the “Quote all text cells” checkbox. (this is not set by default)

    Well, after re-saving it freshly this way, the resulting book2.csv file did import ok using Really Simple CSV Importer into my test environment.

    Link to dropbox of copy of the non-symptomatic file:

    https://www.dropbox.com/s/pp85txcowm8aec7/book2.csv?dl=0

    Hope that helps towards resolving it.

    Will you let us know how you go with this as a follow-up?

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

The topic ‘Error while importing csv having Apostrophe ( ‘ )’ is closed to new replies.