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

Andrew McNamara andrewm@object-craft.com.au
Thu Dec 12 19:50:06 2002


>Magnus> Sorry Dave, I was unclear. I meant with Excel.
>
>Magnus> As far as I understand, you say that you need the broken line
>Magnus> handling to be Excel complient. Right?
>
>Magnus> I have not been able to make Excel import broken lines into a
>Magnus> cell.
>
>I am fairly sure that I have seen cells with newlines in Excel.  I
>have definitely seen them in Access.
>
>Andrew, do you have Excel handy?

Yep. Excel's behaviour is a little bizare - I first tried importing a
file with a CRLF pair in the field - this worked, but left an unprintable
character in the field (a square).

So I started wondering how you actually created a field with a newline in
it from within Excel, because hitting ENTER moves you to the next field.
Some experimentation found the ALT-ENTER combination, which inserts a
newline within the current field.

Looking at the file exported after entering this, I found that fields
with embedded newlines contain only a LF, not CR (and are quoted, as
you would expect).

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/