Title: Problems with CSV export function
Last modified: December 19, 2018

---

# Problems with CSV export function

 *  [blogeescht](https://wordpress.org/support/users/blogeescht/)
 * (@blogeescht)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/problems-with-csv-export-function/)
 * Hi, after using the Flamingo export function I try to import the data into Excel
   by using the Excel Data Import function From Text. As a delimiter I define the
   comma as it is used as such in the exported Flamingo .csv file. Unfortunately
   everytime the text entries in the field “your-message” contains a line break 
   or a comma, this puts the rest of the message in the next Excel row, so this 
   breaks my entire Excel data sheet. As File origin settings in Excel I have chosen
   UTF-8 to display special characters used in the Contact Form 7 entry fields correctly,
   does this have something to do with my broken Excel data sheet or should Flamingo
   be fixed to create a clean .csv-file?
    Regards

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [metfabequipment](https://wordpress.org/support/users/metfabequipment/)
 * (@metfabequipment)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/problems-with-csv-export-function/#post-11061461)
 * You can add this code $input = preg_replace(“/\r\n|\r|\n/”,’ ‘,$input); in /flamingo/
   includes/csv.php into function flamingo_csv_row()
 *     ```
       function flamingo_csv_row( $inputs = array() ) {
       	$row = array();
       	foreach ( $inputs as $input ) {
       		$input = preg_replace("/\r\n|\r|\n/",' ',$input); /*ADD THIS*/
       		$row[] = apply_filters( 'flamingo_csv_quotation', $input );
       	}
   
       	$separator = apply_filters( 'flamingo_csv_value_separator', ',' );
   
       	return implode( $separator, $row );
       }
       ```
   
 * Be careful, file is replace with update
 * To flamingo team : is it possible to add this fix in the new release?
    -  This reply was modified 7 years, 4 months ago by [metfabequipment](https://wordpress.org/support/users/metfabequipment/).
    -  This reply was modified 7 years, 4 months ago by [metfabequipment](https://wordpress.org/support/users/metfabequipment/).
 *  [lvelve](https://wordpress.org/support/users/lvelve/)
 * (@lvelve)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/problems-with-csv-export-function/#post-11386155)
 * [@metfabequipment](https://wordpress.org/support/users/metfabequipment/) You 
   don’t need to replace this code in the plugin!!
 * Ik had the same problem, but you can fix this with a filter. Add the following
   code to the functions.php of your theme and the replace is done in a filter. 
   Export works great after that and newlines are replaced with a space, so the 
   whole record is on one line.
 *     ```
       function sln_content_export($input) {
       	return preg_replace("/\r\n|\r|\n/",' ',$input); 
       }
       add_filter('flamingo_csv_quotation', 'sln_content_export', 999);
       ```
   
 *  [kris5873](https://wordpress.org/support/users/kris5873/)
 * (@kris5873)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/problems-with-csv-export-function/#post-11485437)
 * Adding semicolon **;** instead of comma , did the trick for me on line 10
 * `$separator = apply_filters( 'flamingo_csv_value_separator', ';' );`
    -  This reply was modified 7 years, 1 month ago by [kris5873](https://wordpress.org/support/users/kris5873/).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Problems with CSV export function’ is closed to new replies.

 * ![](https://ps.w.org/flamingo/assets/icon-128x128.png?rev=1540977)
 * [Flamingo](https://wordpress.org/plugins/flamingo/)
 * [Support Threads](https://wordpress.org/support/plugin/flamingo/)
 * [Active Topics](https://wordpress.org/support/plugin/flamingo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flamingo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flamingo/reviews/)

## Tags

 * [csv](https://wordpress.org/support/topic-tag/csv/)
 * [Excel](https://wordpress.org/support/topic-tag/excel/)
 * [export](https://wordpress.org/support/topic-tag/export/)
 * [format](https://wordpress.org/support/topic-tag/format/)
 * [Import](https://wordpress.org/support/topic-tag/import/)
 * [text](https://wordpress.org/support/topic-tag/text/)

 * 3 replies
 * 4 participants
 * Last reply from: [kris5873](https://wordpress.org/support/users/kris5873/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/problems-with-csv-export-function/#post-11485437)
 * Status: not resolved