Submit Your Article Forum Rules

Results 1 to 4 of 4

Thread: New phpMyAdmin CSV Exports Problem

  1. #1
    Senior Member
    Join Date
    Apr 2006
    Location
    Boulder, CO USA
    Posts
    371

    New phpMyAdmin CSV Exports Problem

    I'm wondering if I'm the only one with this problem.
    I've been using and heavily relying on exporting/importing between phpMyAdmin and CSV for years and years.

    Recently, phpMyAdmin was upgraded (both via CPanel and I even downloaded and installed phpMyAdmin myself).
    The "CSV" and "CSV to Excel" exports no longer work properly. The saved file has this problem when read in Notepad so it's not Excel.

    The titles are semicolon delimited in "CSV for MS Excel".
    Exporting plain "CSV", the field names are comma delimited when I designate using a comma.

    Exporting both ways, the content of certain cells are not contained within the proper delimited character which should be a comma.

    Wherever there is a comma in the content of one field, Excel 2010 sees that as a separate cell using that comma as a delimiter, sorta.
    The db is mySQL UTF-8.

    E.g., an excerpt of a field is
    Code:
    and a small, woven, heat-sealed U.S. Flag .75" tall X 1.4" wide, stars forward on the right side of the cap.
    This is what I get when exporting as CSV for MS Excel. (CSV exports as comma delimited, Columns enclosed with a double quote, Columns escaped with [blank] have commas as the field name separators).
    The output is split into two cells where the comma was.
    Notice the missing quote after .75
    Code:
    and a small, woven, heat-sealed U.S. Flag .75 tall X 1.4" wide
    stars forward on the right side of the cap.
    If I escape the columns with a backslash, I get the following still split into two cells.
    Code:
    and a small, woven, heat-sealed U.S. Flag .75\ tall X 1.4\" wide
    stars forward on the right side of the cap.
    Any help getting over this is appreciated.

  2. #2
    WebProWorld MVP kgun's Avatar
    Join Date
    May 2005
    Location
    Norway
    Posts
    8,007
    I have only dumped my databases to a flat sql file for backup purposes with no problem.

  3. #3
    Junior Member
    Join Date
    Dec 2005
    Posts
    15
    I often dump to both CSV and Excel (and ODF). In the case of CSV I never use a comma as a field delimiter - nor, indeed, any character likely to occur in the field content. Re Excel I choose to use an older Excel format such as 2003. With ODF I just go for it on the default settings. All work perfectly - Excel 2007/2010 opens the earlier format and the CSV with no problem (although exporting to xlsx gives rubbish!).
    Chris
    Chris Davis
    Webmaster, The Herpetological Conservation Trust

  4. #4
    Senior Member deepsand's Avatar
    Join Date
    May 2004
    Location
    State College, PA
    Posts
    16,675
    The semi-colon is not universally recognized as a delimiter. And, if data contains the delimiting character, that field must be encapsulated in double-quotes in order for a CSV gile to be properly parsed.

    If possible, use a Tab delimited (.TXT) file. This avoids such problem.

  5. The following user agrees with deepsand:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •