> Which further emphasizes my point that basic ColdFusion solutions of
> looking for carriage returns and the like is not a robust way to solve
> this problem.

I wasn't debating that point. However, it's worth noting that this is
entirely dependent on the application which generated the CSV file. If the
files are all coming from Excel -- which I believe does not allow embedded
carriage returns -- then scanning for carriage returns is perfectly fine.
 
> Well, I would have said "validated" if I meant to a DTD or XSD or some
> such, and I've never even heard of any "validation" mechanisms for CSV
> files other than parsing the file itself.

But you did use the word "valid". That is a loaded term on a ColdFusion
mailing list filled with Web developers. I was merely trying to clarify the
statement.

Your messages seemed to suggest that there was a right and wrong way to
parse a CSV file. I was simply trying to convey that there are as many
correct ways to parse CSV files as there are different flavors of CSV
because CSV is not a standard.

> Sure, but the same could be said of almost any transport medium. For
> example, an XML file might be valid on one system, but not necessarily
> on another if the DTD/XSD it validates against is different.

I think you're conflating the issue (possibly because I mentioned DTDs in
the previous message).

There is an XML standard. Consequently, I can validate the XML document to
ensure that it's properly *formatted*. I can be reasonably sure that, if I
create a standards compliant XML document, that other applications will be
able to parse it. What they do with it from there is up to them.

It's worth noting that, if they can't, then it's probably their fault. In
rare cases, it may be an ambiguity in the standard. This is not the case
with CSV. The format of a CSV file can be perfectly valid for one
application but invalid for another.

XML also supports DTDs, which allow you to validate the *structure* of the
document (as opposed to the format). If a DTD uses an absolute URI (or is
otherwise available on both systems), then the structure of the document can
be validated on both systems.

Since there is no CSV standard, the format cannot be validated. The closest
thing you get to a DTD in a CSV file is when some applications include the
column names in the first line of the file. This tells you the number of
columns that you can expect.

> That's a good one. I'm particularly interested in the CSV to XML
> converter they posted. Thanks for the link.

BTW, I agree with the posts that suggest using DTS, SQLLDR and other such
apps. They've already solved a good deal of the integration problems. DTS in
particular provides a nifty wizard which lets the developer describe the CVS
flavor that you have.

Ben Rogers
http://www.c4.net
v.508.240.0051
f.508.240.0057


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189936
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to