Re: How to convert CSV row to Java object?
On Fri, 27 Aug 2010, Stefan Ram wrote:
"Leonardo Azpurua" <leonardo@exmvps.org> writes:
I mean, if you have a CSV file, you may just read the lines, split them,
convert the data items that need to be converted and store the individual
values in an object.
I can give the specification of XML:
http://www.w3.org/TR/xml11/
So, if anyone now would give me the specification of CSV,
we can go on and compare the two.
http://www.ietf.org/rfc/rfc4180.txt
I don't know how good compliance to this spec is, to put it mildly.
But then, half the XML out there today uses namespaces, and there is no
coherent spec for namespaces. Yes, there is a spec, but you can't actually
use it in practice without violating the main XML spec.
Otherwise, one can state than an advantage of XML is that
it is specified.
Except that nobody ever gives you an XML file. They give you a file in
some particular application of XML - XHTML or DocBook or WSDL or whatever.
You need a separate spec for that to be able to do anything useful with
it. When someone gives you a CSV, you're in much the same situation.
tom
--
Why did one straw break the camel's back? Here's the secret: the million
other straws underneath it - it's all mathematics. -- Mos Def