A brief overview of CSV (comma-separated values)

As the name suggests, a CSV file is simply a set of values separated by commas or a delimiting element such as a semi-colon or even a tab-space.

It enables you to record data in columns and rows, for example in its most basic form:

"ID", "Date", "Time", "Message"
"1001", "11Feb2012","03:06","How's that CSV post coming along?"
"1003", "10Mar2012","11:12","Is it ready yet?"

Note: Typically the first row contains the column headers, and be aware that the quotation marks are non-essential and can be mixed and matched - e.g. used only when commas or other special characters might interfere with how the data is parsed.

Try copying and pasting the above code into a text editor like TextWrangler and saving the file with a .csv extension. Make sure that there are no white spaces between the commas and the quotation marks, and that the end of every line has a return. Next open the file in OpenOffice (Calc), and when prompted select the comma as the delimiter and the correct quotation marks as the text delimiter.


 Pressing OK will import the file.


This functionality of CSV makes it ideal for the exchange of spreadsheet data between incompatible applications, but the format is not restricted to the desktop it can also be used on the web and now you know the basics, why not go off and explore?

Comments