CSV file format comments

Discussion in 'Java' started by Roedy Green, Aug 1, 2003.

  1. Roedy Green

    Roedy Green Guest

    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?

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Aug 1, 2003
    #1
    1. Advertising

  2. Roedy Green

    Wendy S Guest

    "Roedy Green" <> wrote

    > 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.

    --
    Wendy in Chandler, AZ
     
    Wendy S, Aug 1, 2003
    #2
    1. Advertising

  3. Roedy Green

    Andy Fish Guest

    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.

    "Roedy Green" <> wrote in message
    news:...
    > 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?
    >
    > --
    > Canadian Mind Products, Roedy Green.
    > Coaching, problem solving, economical contract programming.
    > See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Andy Fish, Aug 1, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    6
    Views:
    480
    Thomas Ganss
    Jan 15, 2006
  2. Tintin92
    Replies:
    1
    Views:
    1,807
    Andrew Thompson
    Feb 14, 2007
  3. Monk
    Replies:
    10
    Views:
    1,544
    Michael Wojcik
    Apr 20, 2005
  4. jliu66
    Replies:
    0
    Views:
    562
    jliu66
    Oct 19, 2007
  5. Li Chen
    Replies:
    18
    Views:
    719
    Azmi Farih
    Mar 23, 2010
Loading...

Share This Page