CSV

From BC$ MobileTV Wiki
Jump to: navigation, search

Comma Separated Values (commonly abbreviated CSV) is data and/or a file format whereby individual entries (types) of information are delimited by a comma ("," character) and different records (objects) are delimited by a breaking character (typically the newline character). It is a simple format but can be used to represent fairly complex data structures despite certain limitations. Other spacing characters (i.e. whitespace such as tabs and spaces) are typically ignored. Labels can are typically specified in the first row (i.e. before the first line-breaking character).


Specifications

CSVW

CSV on the Web (CSVW) is a set of standards around the syntax, formatting, data types, headers and overall structure of CSV files/data to ensure the interoperability of such data between systems, applications and services on the web.


EXAMPLES

For example, the CSV list for counting from one to six would read as follows:

1, 2, 3, 4, 5, 6

A more complex data structure containing 6 people's person information (with only one record, Stephen Tyler containing a secondary address) would be:

FIRST NAME, LAST NAME, STREET ADDRESS, CITY, STATE/PROV, COUNTRY, ZIP/POSTAL, STREET ADDRESS-2, CITY-2, STATE/PROV-2, ZIP/POSTAL-2
John,Doe,120 jefferson st.,Riverside, NJ, USA, 08075
Jack,McGinnis,220 hobo Av.,Phila, PA, USA, 09119
"John ""Da Man""",Repici,120 Jefferson St.,Riverside, NJ,USA,08075
Stephen,Tyler,"7452 Terrace ""At the Plaza"" road",SomeTown,SD,USA, 91234, 123 Four Ct.,SomeTown, SD,USA, 00298
"Joan ""the bone"", Anne",Jet," 9th, Terrace plc",Desert City,CO,USA,00123
Peter,Carter, 123 Somewhere st, Anywhereville,CA,  B2P1M6





Tools


Resources

Java

JavaScript

PHP

VB/ASP


Tutorials

[2]


External Links

See Also

XML | JSON
  1. CSVW Primer on GitHub: http://w3c.github.io/csvw/primer/
  2. Parsing CSV in Java: https://stackoverflow.com/questions/3908012/parsing-csv-in-java