[Tutor] Wanted: module to parse out a CSV line

Magnus Lycka magnus@thinkware.se
Thu Dec 12 08:36:59 2002


At 22:22 2002-12-12 +1100, Dave Cole wrote:
>Magnus> On the other hand, I still don't manage to get it to read
>Magnus> strings with embedded line breaks. Also, I don't manage to get
>Magnus> it to export CSV files with embedded line breaks. How is that
>Magnus> done?
>
>The module assumes that you are reading your input one line at a time
>and passing the lines to the parser as you read them.

Sorry Dave, I was unclear. I meant with Excel.

As far as I understand, you say that you need the broken line handling
to be Excel complient. Right?

I have not been able to make Excel import broken lines into a cell.

<WARNING>ASCII art below</WARNING>

2,"Hello
there"

Will become

+------+------+
|2     |Hello |
+------+------+
|there |      |
+------+------+

in excel, not

+------+------+
|2     |Hello |
|      |there |
+------+------+

as I guessed it would, considering that csv does that with reference to Excel.

Also, if I enable wordwrap in cells,

+------+------+
|2     |Hello |
|      |there |
+------+------+

will still be exported as

2,Hello there

not

2,"Hello
there"

So I wonder, how do you manage to get something like

2,"Hello
there"

out of Excel? I've been unable to paste a line feed into a cell.


-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se