• Resolved Hefikz

    (@hefikz)


    To avoid problems with linebreaks when importing exported csv to Excell,
    a solution would be to replace in the file cforms2\include\lib_database_dlentries.php, line 282

    function cforms2_enc_data ( $d, $charset ){
    	$d = str_replace( array('"',"\r","\n"), array('"',"","\r"),$d );
    	$d = ( $charset=='utf-8' ) ? $d : utf8_decode($d);
    	return $d;
    }

    by

    function cforms2_enc_data ( $d, $charset ){
    	$d = str_replace( array('"',"\r","\n"), array('"'," "," "),$d );
    	$d = ( $charset=='utf-8' ) ? $d : utf8_decode($d);
    	return $d;
    }

    Is it also possible to have a semicolon instead of a comma as a separator in the csv format ? Because it’s easier to have a semicolon than a comma in csv when importing directly into excell. May be a parameter in the form could do the trick.

    Thanks,

    Hefikz

    https://wordpress.org/plugins/cforms2/

Viewing 1 replies (of 1 total)
  • Plugin Author bgermann

    (@bgermann)

    The newlines are converted to have one line per data tuple. I will not introduce any new data separators, because some time this feature will be gone.

Viewing 1 replies (of 1 total)

The topic ‘Problem with Newlines in csv exports’ is closed to new replies.