Hmmm... getting a bit complicated now. I think George's suggestion to DCOUNT the header line and concat if the number of columns are less might be simpler.

I really appreciate all the ideas, though. They give me something to think about.

Charlie

"Make things as simple as possible, but not simpler." - Albert Einstein

On 02-09-2012 11:16 AM, Robert Houben wrote:
The trick is to NOT read up to a CR or LF, first, and process that as a line. 
You have to read the file as a stream, literally byte-by-byte, and recognize 
when you are processing quotes and handle that with different logic.

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen
Sent: February-09-12 9:04 AM
To: U2 Users List
Subject: Re: [U2] Building an Excel File

What Symeon suggests should still work, since the break is inside the quotes 
(assuming your using Quoted csv and not tabs), so if you go byte by byte, if 
you encounter a cr that is inside quotes Escape it and keep reading, if you 
encounter a cr that is between quotes, consider that the end of the row.

George

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Charlie Noah
Sent: Thursday, February 09, 2012 11:57 AM
To: U2 Users List
Subject: Re: [U2] Building an Excel File

The problem occurs before it ever gets to UV (or in my case jBASE). The csv 
flat file already has the cell split into 2 lines.

On 02-09-2012 10:53 AM, Symeon Breen wrote:
It is entitrely possible and ok to have new lines inside a cell in
excel and inside a cell in a  csv The following

"col1",2,"col3 and
New line",col4


Is ok  because the new line is inside the quotes of col3


The trick when parsing in u2 is to not do it line by line, but byte by
byte

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to