Auto-detect CSV Separator
page 2 of 4
by Josip Kremenic
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 24518/ 37

CSV Format

Rules for writing CSV files are pretty simple:

·       if value contains separator character or new line character or begins with a quote – enclose the value in quotes,

·       if value is enclosed in quotes – any quote character contained in the value should be followed by additional quote character.

These two simple rules enable us to write CSV writers easily, in just few minutes. Implementing CSV reader is much more problematic because CSV stream has to be parsed sequentially, character by character and additional state storage has to be provided – which effectively makes CSV reader a state machine. There are a lot of CSV readers out there that have wrong implementation because they do not follow the rules stated above.


View Entire Article

User Comments

No comments posted yet.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-25 10:54:02 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search