Case Study: CSV Library (cont)
Definition of field seems simple from above example.
However, there are some subtle issues:
- fields are separated by commas
- fields may be enclosed in quotes (
"..." )
(not treated as part of value)
- within quotes:
"" is replaced by " , comma is not a separator
Example, the CSV line:
123,"abc",,""",""","",I am,
|
has fields
('123', 'abc', '', '","', '', 'I am', '')
|
|