Support

Home Forums Event Espresso Premium CSV-import problem

CSV-import problem

Posted: May 9, 2016 at 6:25 am


Jakob Naredi

May 9, 2016 at 6:25 am

Hi,

I’m trying to import the CSV-file (that has been exported from EE4) into excel. I get the results cut and on different rows.

The problem happens when someone has put a line break into a text area (custom registration form). Then the data isn’t imported correct.

Anyone that has a solution? Either in EE4 or in Excel.

Thanks,
Jakob


Lorenzo Orlando Caum

  • Support Staff

May 9, 2016 at 11:29 am

Hi Jakob,

I can check into this for you. Are you seeing this issue on the latest release?

https://eventespresso.com/wiki/ee4-changelog/

Next, could you share the custom question types (e.g. textarea) that are in use in your custom registration form?

We’ll then test this out on our testing site.

Thanks


Lorenzo


Jakob Naredi

May 10, 2016 at 2:52 am

Yes, the version is 4.8.43.p.

In the form we are using text, textarea, checkboxes and radio buttons. But it’s only when there is a line brake added to the text area we got a problem (it’s only possible to add line brakes on text areas).

I could send you our csv list if you would like to have a look.


Tony

  • Support Staff

May 10, 2016 at 3:46 am

Hi Jakob,

I’ve just added a couple of registrations using a text area within the question group and added multiple returns within that text area. It did not cause any problems within the CSV – http://take.ms/FpASv

On load it only shows a single line but no other problems.

If you can send me a copy of your CSV I’ll see if I can spot anything with that, you can send it to support[at]eventespresso.com

Please include a link to this thread within the email so we know what it is for.


Tony

  • Support Staff

May 10, 2016 at 5:24 am

Which version of Excel are you using?

Can I ask why you need to import the CSV and not just open it within Excel?


Jakob Naredi

May 10, 2016 at 5:52 am

It’s office 365 the updated version.

I have sent a picture how it looks like when opening it directly in excel.


Tony

  • Support Staff

May 10, 2016 at 6:15 am

I’ve sent you an amended version of your CSV file, can you try opening that and let me know how that looks please.


Jakob Naredi

May 12, 2016 at 2:02 am

Thanks for your help Tony!

This code solved the problem:

//This function swaps out any new lines within the CSV values for a single space.
function tw_ee_swap_newlines_for_spaces_in_export($reg_csv_array, $reg_row) {
	foreach( $reg_csv_array as $key => $value ) {
		$clean_value = preg_replace("/[\r\n]+/", " ", $value);
		$reg_csv_array[$key] = $clean_value;
	}
	return $reg_csv_array;
}
add_filter( 'FHEE__EE_Export__report_registrations__reg_csv_array', 'tw_ee_swap_newlines_for_spaces_in_export', 100, 2 );


Tony

  • Support Staff

May 12, 2016 at 3:01 am

I’m glad that function worked for your Jakob 🙂

I have added that to our code snippet library here:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/admin/tw_ee_replace_newlines_for_spaces_in_export.php

The support post ‘CSV-import problem’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso