WordPress.org

Ready to get started?Download WordPress

Forums

[Users to CSV] Failing to open the CSV file (5 posts)

  1. talgalili
    Member
    Posted 6 years ago #

    I can not open the CSV file, and get the error:
    "cannot read record 12"

    (but when I go and open the file in "notepad" it opens fine)

    P.s: can I ask to enable exporting of other users fields ?
    Such as the one added by: Register Plus

    http://wordpress.org/extend/plugins/users-to-csv/

  2. evilzenscientist
    Member
    Posted 6 years ago #

    The plugin is creating the csv with a semi-colon instead of a comma.

    Edit line 37 of the plugin:

    function arrayToCsvString($array, $separator=',', $trim='both', $removeEmptyLines=TRUE) {

  3. Osu
    Member
    Posted 6 years ago #

    Hi,

    I edited that line of code, and can open it with a basic text-editor, but not with Excel 2008. Is there a reason for that and is it important?

    Thanks

  4. flick
    Member
    Posted 6 years ago #

    Not sure if it's a good idea to use a comma instead of a semi-colon as a separator. It depends on the data though I guess. Most of my data have sentences which *have* commas but not necessarily semi-colons, so the colon seems ideal.

    If possible could maybe use '|'?

  5. ehsan4php
    Member
    Posted 5 years ago #

    Using version 1.4 and here are the places I had to modify:

    1. Line 56 (which evilzenscientist referred to line 37), same modification. Although only changing it doesn't fix the ";" problem, so following is the next.

    2. Line 194 change $sep = ";"; to $sep = ",";

    3. Then there was a problem with MS Excel that reported something like:

    "Excel has detected that the 'MyOutput.csv' is a SYLK file, but cannot load it. Either the file has errorsa or it is not a SYLK file. Click OK to try to openn the file in a different format."

    To fix it I had to replace all the instance of 'ID' to 'USERID', that solved all the issues.

    So far so good. I will report more changes if there is any.

Topic Closed

This topic has been closed to new replies.

About this Topic