Results 1 to 6 of 6

Thread: Commas and line breaks missing from csv output file

  1. #1
    Join Date
    Jun 2009
    Location
    Portland, OR USA
    Posts
    7

    Default Commas and line breaks missing from csv output file

    Hello - I've gotten my formmail form to sucessfully create a CSV file and add new data to it. (Version 8.15)

    My issue is that it doesn't include the commas or line feeds to separate the columns and records. HELP!

    Here is the code I added to my .html form input file:
    Code:
    <input type="hidden" name="csvcolumns" value="email,realname,contact_phone" />
    This is what I get:

    Code:
    emailrealnamecontact_phone"sample@email1.com""test firstname lastname""test phone""sample@email2.com""test firstname 2 lastname 2""test phone 2""sample@email3.com""test firstname 3 lastname 3""test phone 3"
    Here is the relevant code in the formmail.php file:

    Code:
    $CSVSEP = ",";      // comma separator between fields (columns)
    
    $CSVINTSEP = ";";   // semicolon is the separator for fields (columns)
                        // with multiple values (checkboxes, etc.)
    $CSVQUOTE = '"';    // all fields in the CSV are quoted with this character;
                        // default is double quote.  You can change it to
                        // single quote or leave it empty for no quotes.
    //$CSVQUOTE = "'";  // use this if you want single quotes
    $CSVOPEN = "b";      // set to "b" to force line terminations to be
                        // kept as $CSVLINE setting below, regardless of
                        // operating system.  Keep as empty string and
                        // leave $CSVLINE unchanged, to get text file
                        // terminations for your server's operating system.
                        // (Line feed on UNIX, carriage-return line feed on Windows).
    $CSVLINE = "\r\n";    // line termination for CSV files.  The default is
                        // a single line feed, which may be modified for your
                        // server's operating system.  If you want to change
                        // this value, you *must* set $CSVOPEN = "b".
    I enabled the CSVOPEN and CSVLINE in hopes to at least get line breaks, but it didn't work either.

    Looking through the formmail.php file, I found there are other sections dealing with csv that might be related to the issue, but I didn't make any changes to them.

    Thanks for any ideas!

  2. #2
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Commas and line breaks missing from csv output file

    ur saying u dont even get commas!?!

    that means u have something real wrong

    for keeping lines in field values:
    http://www.tectite.com/fmdoc/limited_import.php

  3. #3
    Join Date
    Jun 2009
    Location
    Portland, OR USA
    Posts
    7

    Default Re: Commas and line breaks missing from csv output file

    Quote Originally Posted by crabtree View Post
    ur saying u dont even get commas!?!

    that means u have something real wrong

    for keeping lines in field values:
    http://www.tectite.com/fmdoc/limited_import.php

    Yeah, no commas. Thanks for that link. I changed my Limited_Import variable to false from true and no difference. I think I should try a fresh install of my script, rather than starting from another formmail.php through the upgrade wizard. Thx...

  4. #4
    Join Date
    Jun 2009
    Location
    Portland, OR USA
    Posts
    7

    Default Re: Commas and line breaks missing from csv output file

    Tried with fresh install, then changed limited_import to false again and still no change. I even tried chaning the file type from csv to txt and same thing.

    I can create a work around by including a special hidden 'end of line' field that I can just have the person who processes the data search and replace with a line feed, and they'll have to separate the field names manually, before she imports into her excel spreadsheet.

    Regardless, the runtogether csv file I get is better than having to process individual email versions of the form submission.

  5. #5
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Commas and line breaks missing from csv output file

    thats really weird.

    if you have:
    PHP Code:
    $CSVSEP ","
    in formmails config, then you will get those characters (commas) between each field

    i think u should subscribe and get support from the author - i dont think theres a problem with formmail but u must have something weird going on for this basic funciton not to work

  6. #6
    Join Date
    Jun 2009
    Location
    Portland, OR USA
    Posts
    7

    Default Re: Commas and line breaks missing from csv output file

    As an update to this issue:
    The newer script CSV forms have worked just fine

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. CSV Output
    By eu4ic in forum FormMail Subscription Support
    Replies: 14
    Last Post: 13-May-2004, 08:51 PM
  2. Submitted form output onto HTML page?
    By LKimber in forum FormMail Subscription Support
    Replies: 2
    Last Post: 13-Apr-2004, 10:39 AM
  3. html output?
    By Ibis in forum FormMail Subscription Support
    Replies: 1
    Last Post: 28-Feb-2004, 08:08 AM
  4. output form into a webpage
    By redsnow in forum FormMail Subscription Support
    Replies: 3
    Last Post: 10-Feb-2004, 11:34 AM
  5. Output format
    By Beamin1 in forum FormMail Subscription Support
    Replies: 4
    Last Post: 18-Jan-2004, 07:46 AM

Bookmarks

Posting Permissions

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