OpenNETCF.Data.Csv - Limitations?

  • Thread starter Thread starter Paul [Paradise Solutions]
  • Start date Start date
P

Paul [Paradise Solutions]

Hi all

I'm looking into CSV file input into my application and was wondering if
anyone can tell me if there are any limitations before I start faffing
with code?

As a rule for CSV is pretty much "anything followed by anything else is
valid" I was wondering what this class can deal with. Are string values
required to be enclosed in quotes (I have seen occasions where they aren't)?
Would is correctly interpret the 'bad' line below?

E.g.:

A 'good' csv line
"entry1","entry2"

...2 fields

A 'bad' csv line
"2" moulding (pine)",1.5,"ordered "on request",2 week lead time"

... 3 fields, 1 text, one numeric, 1 text




Many thanks


Paul
 
It doesn't have the capability to cope with the sample you have posted. It
works by splitting the row on the Comma (or for the next release any other
delimiting char e.g. Tab) unless the item is quoted in which case the quote
item is treated as a single entry after which it expects a comma, I haven't
tried it but I would expect it to error on the data, at least you won't get
out what you expect without some serious changes to the code. If you have
any control over the data export into CSV, then if you can replace quotes
within text to single quotes then you may have more luck.

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups
 
I was frightened the responce would be that... Much as it pains me to
say it, eVB *could* handle the 'bad' example correctly - sure as hell
wish someone would explain how!


Thanks for your reply.


Paul
 
strRec = File1.InputFields(expectedNoOfFields)

function return made strRec an array of the values

Paul
 
Back
Top