CSV file format comments

R

Roedy Green

I would find it highly convenient to be able to tuck comments in CSV
(Comma Separated Value) files. I could label the fields, give hints
on max lengths, add notes on what the file is for etc.

Since I wrote CSVReader, I could invent my own comment convention, and
have a boolean in the constructor if you wanted such comments
bypassed.

Ideally I would like to use some widely accepted convention. I
sniffed around Google and did not come up with anything. Is there one?
 
W

Wendy S

Roedy Green said:
Ideally I would like to use some widely accepted convention. I
sniffed around Google and did not come up with anything. Is there one?

I don't think so, usually one gets a data layout separately from the csv or
flat file, and that has all of the information.

If column headings are included, they are usually done on the first line:
"FirstName","LastName"
"Wendy","Smoak"

As for comments, I'd say just pick a character, maybe % or # and declare
that if it is the first character found on a line, then everything on that
line will be ignored.

But then your files will not be useable with other programs, such as Excel
which is usually mapped to the 'csv' extension on Windows machines.
 
A

Andy Fish

I wish someone would take it upon themselves to 'own' CSV file format and
publish a definitive spec - even if it was M$.

maybe we should all abandon it and only ever talk XML nowadays.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,190
Latest member
ClayE7480

Latest Threads

Top