If you wanrt to keep them, don't remove them.
but they mess up the csv, data in the wrong columns
1 person found this helpful
Ditch CSV and try a more robust format like JSON:
Otherwise for superior situations, use the binary AMF protocol.
but the users download the csv and open in excel, can it be done in JSON?
JSON is for 'transfering' information that can be reassembled into number, string, array, object, etc. format afterwards.
Excel can import CSV but it might not understand the complexity of the information. Tyically what you would do is serialize complex information with JSON, recieve it on the other side (wherever that might be) and then deserialize it. After you deserialize it using JSONs abilities to turn your information back into what is was (numbers, strings, arrays and object) it is up to you how you restructure the data for the format you choose.
Your original intent of preserving CSV is best for Excel or OpenOffice Calc. You didn't mention your intent. JSON would package those (CRLF) \n's for you.