• 0

csv file question/explanation


Question

Heres the deal:

Im supposed to write a program (in Java) that can import csv files, and display its contents on the screen. I got the hole thing pretty much done except for the important issue of importing the file.

My question right now is, what caracter is used in csv files to separate the different collums? If I open a csv file in notepad i just see a square :(

If u could tell me the unicode character code that would be great

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

csv (comma separated value)are usually separated by "," but can be ";" or a few other values. Most common are the "," and ";" types. From what I have encountered anyway.

Link to comment
Share on other sites

  • 0

By default all values (columns) are separated by comma and records (lines) by a linebreak in the CSV format.

Any value containing a comma must be quoted, but in some instances you can use something else than a comma to separate the values.

A good idea is to allow choosing which character is used to separate values, as that is more flexible (but use comma as the default).

Excel can import and export CSV files, so you can do some experimentation with that program to see various behavior.

In general, all text values are quoted and all numbers are unquoted.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.