C
C
CartmanGui2016-09-09 02:25:00
PHP
CartmanGui, 2016-09-09 02:25:00

How to parse string in CSV whose cell contains newline character?

I'm trying to parse a CSV file with fgetcsv, but the problem is that some row cells may contain a newline character and because of this everything breaks. Whether it is possible to cure it somehow? Because if you open such a file in Microsoft Excel or Numbers for Mac, then how would they normally display it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2016-09-09
@CartmanGui

Cartman GUI

this is what your cvs looks like after importing into excel and numbers:
e74a683ea2e4485eb629618154511aaa.pngc92162cb0a104cb6bd5e9afbab7d1d06.png
why you decided that puff (which does exactly that) should do otherwise, I don’t know.

E
entermix, 2016-09-09
@entermix

And what exactly is the problem? What do you mean by "it breaks everything"?
Would like to know...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question