CSV
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).
Contents
Specifications
- CSV spec: https://tools.ietf.org/html/rfc4180 (RFC-4180)
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.
- W3C working group - CSV on the Web (CSVW): https://www.w3.org/2013/csvw/wiki/Main_Page | DOCS
- CSVW - A Primer to "Open" Tabular data: https://www.w3.org/TR/tabular-data-primer/[1]
- CSVW - Namespace Vocabulary Terms: https://www.w3.org/ns/csvw
- pycsvw: https://github.com/bloomberg/pycsvw (tool to read CSV files with CSVW metadata and transform them into other formats in Python code)
- CSVW parser: https://github.com/sebneu/csvw-parser
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
- CSV to XML Converter: http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm#ProcForm
- CSV to JavaScript: http://www.creativyst.com/cgi-bin/Prod/17/eg/csv2js.pl
- CSV-2-JSON: https://csvjson.com/csv2json
- Convert data between CSV and JSON: https://csv.js.org/convert/<ef>JSON to CSV Converter: http://jsfiddle.net/gonzif/MfJPF/1/
- CSV to vCard: http://homepage.mac.com/phrogz/CSV2vCard_v2.html
- CSV or TSV formatted data to JSON converter: https://www.csvjson.com/csv2json
Resources
Java
- OpenCSV: http://opencsv.sourceforge.net/project-info.html | DOCS | SRC
- java-csv: http://sourceforge.net/projects/javacsv/
- StelsCSV java CSV database lib: http://sesamesoftware.com/solutions/jdbc-database-drivers-products/jdbc-database-drivers-csv/ (CSV JDBC type 4 driver that allows performing SQL queries and other JDBC operations on CSV text files)
- com.Ostermiller.util.CSV -- Java Utilities (GPL): http://ostermiller.org/utils/CSV.html
- Java CSV Parser Based on Regular Expressions (no lib required): https://web.archive.org/web/20140701003619/http://vichargrave.com/java-csv-parser/
- CSV Reader: https://www.csvreader.com/java_csv.php
JavaScript
- CSV parser using javascript: http://purbayubudi.wordpress.com/2008/11/09/csv-parser-using-javascript/
- jQuery CSV parser plugin: https://github.com/evanplaice/jquery-csv
PHP
- CSV Parser for PHP: http://minghong.blogspot.com/2006/07/csv-parser-for-php.html
VB/ASP
- Enhanced Split Function for VB.NET: http://www.freevbcode.com/ShowCode.asp?ID=4938&NoBox=True
Tutorials
- Reading in a *.csv file and loading the data into an Array: http://www.daniweb.com/forums/thread17262.html
- Splitting a line of text in PHP (using explode & de-limiter): http://www.homeandlearn.co.uk/php/php7p5.html
- Using CSV Files as Databases and Interacting with Them Using Java: http://www.devarticles.com/c/a/Java/Using-CSV-Files-as-Databases-and-Interacting-with-Them-Using-Java/
- How to import/read & parse CSV file in Java: https://www.mkyong.com/java/how-to-read-and-parse-csv-file-in-java/
- How to export data to CSV file – Java: https://www.mkyong.com/java/how-to-export-data-to-csv-file-java/
- CSV Operations (in Java) using OpenCSV: http://architects.dzone.com/articles/csv-operations-using-opencsv
- How can I convert JSON to CSV?: http://stackoverflow.com/questions/1871524/how-can-i-convert-json-to-csv (Python example of JSON-to-CSV)
- Convert JSON format to CSV format for MS Excel: http://stackoverflow.com/questions/4130849/convert-json-format-to-csv-format-for-ms-excel
- The Only Class You Need for CSV Files: https://agiletribe.wordpress.com/2012/11/23/the-only-class-you-need-for-csv-files/
- Export HTML Table Data to CSV using JavaScript: https://www.codexworld.com/export-html-table-data-to-csv-using-javascript/
- How to read a CSV file with Node.js: https://flaviocopes.com/node-read-csv/
- How to write a CSV file with Node.js: https://flaviocopes.com/node-write-csv/
External Links
See Also
XML | JSON- ↑ CSVW Primer on GitHub: http://w3c.github.io/csvw/primer/
- ↑ Parsing CSV in Java: https://stackoverflow.com/questions/3908012/parsing-csv-in-java