CSV (comma separated values): Difference between revisions

From Tygron Preview Support Wiki
Jump to navigation Jump to search
(Created page with "==What are comma separated values (CSV)?== Comma separated values (CSV) is a specification of tabulated data, where the data is stored in a text based file and (historically)...")
 
No edit summary
Line 1: Line 1:
==What are comma separated values (CSV)?==
==What are comma separated values (CSV)?==
Comma separated values (CSV) is a specification of tabulated data, where the data is stored in a text based file and (historically) entries are separated with a comma. Currently also other separators are in use, such as the semi colon (';') and the tab ('\t').
CSV files are used to transfer data sets between infoirmation systems that do not use the same data format. For example, by using the CSV format, data from a data base in a propriarity format can be transferred to a spread sheet program with another propriarity format.


CSV files are used to transfer data sets between infoirmation systems that do not use the same data format. For example, by using the CSV format, data from a data base in a propriarity format can be transferred to a spread sheet program with another propriarity format.
Comma separated values (CSV) is a specification of tabulated data, where the data is stored in a text based file and (historically) entries are separated with a comma.
 
In the Anglo Saxon influence sphere, commas are in use as separators. However, in the rest of the world commas are already in use as decimal separators and periods as thousand-separators, hence the use of semi colons in stead in these regions.
 
When copying an HTML table into memory, to paste it in plain text or spreadsheet, the tab character ('\t') is automatically used as separator.
 
A CSV file can be read with a simple text editor and consists of line entries that correspond with the rows in a spreadsheet. Each line (row) has the same number of (column) entries, separated with a comma or other separator. The first line can be used to name column headers of the resulting table. Lines are sometimes ended with only line feed and no carriage return, which results in the text being displayed in an editor as one single line without separation per table row. Spreadsheets can ususally read these line feeds without problem, ordering the data in its proper rows again.
 
You can create your own CSV file, as shown below:
 
We have a simple data set of some produce: 10 apples, 5 oranges, 1 tomatoe and 3 onions. We would like to create a table from a CSV file with headers that displays the name, type, color and quantity.
 
We begin with the first line of column headers:
 
<code>name; type; color; quantity</code>
 
Then we add the first entry row:
 
<code>name; type; color; quantity<br>
apple; fruit; green; 10</code>
 
Now we add the other entries:<br>
 
<code>name; type; color; quantity<br>
apple; fruit; green; 10<br>
orange; fruit; orange; 5<br>
tomatoe; vegetable; red; 1<br>
onion; vegetable; yellow; 3</code>
 
This CSV file will result in a similar table as below, when importing the file in a spread sheet program:


A CSV file can be read with a simple text editor and consists of line entries that correspond with the rows in a spreadsheet. Each line has the same number of entries, separated with a comma or other separator. Lines are sometimes ended with only line feed and no carriage return, which results in the text being displayed in an editor as one single line without separation per table row. Spreadsheets can ususally read these line feeds without problem, ordering the data in its proper rows again.
{| class="wikitable"
! name
! type
! color
! quantity
|-
| apple
| fruit
| green
| 10
|-
| orange
| fruit
| orange
| 5
|-
| tomatoe
| vegetable
| red
| 1
|-
| onion
| vegetable
| yellow
| 3
|-
|}


What kind of file it is
What kind of file it is
How it is structured
How it is structured
Why/where they are used
Why/where they are used
How to create your own
How to create your own



Revision as of 10:27, 2 September 2020

What are comma separated values (CSV)?

CSV files are used to transfer data sets between infoirmation systems that do not use the same data format. For example, by using the CSV format, data from a data base in a propriarity format can be transferred to a spread sheet program with another propriarity format.

Comma separated values (CSV) is a specification of tabulated data, where the data is stored in a text based file and (historically) entries are separated with a comma.

In the Anglo Saxon influence sphere, commas are in use as separators. However, in the rest of the world commas are already in use as decimal separators and periods as thousand-separators, hence the use of semi colons in stead in these regions.

When copying an HTML table into memory, to paste it in plain text or spreadsheet, the tab character ('\t') is automatically used as separator.

A CSV file can be read with a simple text editor and consists of line entries that correspond with the rows in a spreadsheet. Each line (row) has the same number of (column) entries, separated with a comma or other separator. The first line can be used to name column headers of the resulting table. Lines are sometimes ended with only line feed and no carriage return, which results in the text being displayed in an editor as one single line without separation per table row. Spreadsheets can ususally read these line feeds without problem, ordering the data in its proper rows again.

You can create your own CSV file, as shown below:

We have a simple data set of some produce: 10 apples, 5 oranges, 1 tomatoe and 3 onions. We would like to create a table from a CSV file with headers that displays the name, type, color and quantity.

We begin with the first line of column headers:

name; type; color; quantity

Then we add the first entry row:

name; type; color; quantity
apple; fruit; green; 10

Now we add the other entries:

name; type; color; quantity
apple; fruit; green; 10
orange; fruit; orange; 5
tomatoe; vegetable; red; 1
onion; vegetable; yellow; 3

This CSV file will result in a similar table as below, when importing the file in a spread sheet program:

name type color quantity
apple fruit green 10
orange fruit orange 5
tomatoe vegetable red 1
onion vegetable yellow 3

What kind of file it is

How it is structured

Why/where they are used

How to create your own

CSV (comma separated values) and the Tygron Geodesign Platform

Link to attribute arrays You can use , ; \t etc Csv can contain 10.000 time steps

See also

How to load in dynamic rain and simulation time (Water Overlay)
How to set dynamic breach height
How to load in dynamic evaporation rate (Water Overlay)