Viewfinder Design Support Forum » Miscellaneous

Viewfinder Mailing List - Importing CSV error

(5 posts)
  • Started 3 years ago by zuryasse
  • Latest reply from omarmoss
  • This topic is not resolved

  1. I'm getting the following error when trying to import my CSV mailing list (just exported from Excel):
    ----------
    Warning: fgetcsv() [function.fgetcsv]: enclosure must be a character in /home/zuryasse/public_html/vmlinstall/common/functions.php on line 49

    Import complete, please check a few of the people on the list you imported to ensure they appear as you expect.
    ---------

    sure enough, the list is empty.

    Thanks for the support!

    Posted: 2007-07-06 23:31:07 #
  2. I haven't tested this, but try opening functions.php and changing line 43 from:

    function parse_csv_file($file, $columnheadings = false, $delimiter = ',', $enclosure = null) {

    to

    function parse_csv_file($file, $columnheadings = false, $delimiter = ',', $enclosure = "") {

    Alternatively, try changing line 56 from:

    while (($data = fgetcsv($handle, 1000, $delimiter, $enclosure )) !== FALSE) {

    to

    while (($data = fgetcsv($handle, 1000, $delimiter)) !== FALSE) {

    Posted: 2007-07-07 19:18:19 #
  3. Hi,

    well, the first solution didn't change anything.
    the second (which was for line 49 and not 56) changed the error message to:

    Error: incorrect field name (vml_subscribers a.saba@tin.it a_osman@adamyoung.com a_rociogomez@latinmail.com adria@orabidu.com adrian.mpiton2000@gmail.com adrianadoval@yahoo.com.ar adrianux1@yahoo.com.mx adularia74@hotmail.com aduran@lacaixa.es advtfobhe) used or non-existant field

    I tried it before with 'email' on top of the list, it was the same. Any ideas? Thanks so much for the support!

    Zury.

    Posted: 2007-07-09 13:20:57 #
  4. Right, figured it out. Not a problem with the import process but a problem with the file you are trying to upload.

    It seems that PHP has trouble understanding line breaks in Mac text files.

    So, you can fix it in one of two ways:

    1. Get your web host to enable the auto_detect_line_endings option in their php.ini file

    2. Save your file with Windows formatted line breaks

    Works fine when the latter is done.

    Posted: 2007-07-10 21:42:24 #
  5. omarmoss
    Member

    Warning: fgetcsv(): enclosure must be a character in /home/website/web/subscription/common/functions.php on line 49

    From what I understand, I need to save a comma seperated file containing email addresses. Does the list need to also be line broken?

    I have tried many different ways to save the csv file using notepad, 'all filetypes' in ANSI, Unicode and UTF-8, none of which seem to work. (also straight out of Excel as csv)

    Could someone please explain to me exactly what the format of the csv file should be in in notepad as well as if commas and/or line breaks are necissary.

    Thank you very much. So far this seems like a great tool :)

    Posted: 2008-08-29 15:29:01 #

RSS feed for this topic

Reply

You must login to post.