For more information, see Comma-separated values on Wikipedia.

A Comma Separated Values (CSV) file is a plain text file that represents a table of data. These files often have the file extension .csv or .txt. It is often used by programs such as Microsoft Office & LibreOffice Calc to share data.

Format

A CSV file consists of values separated by commas (,). Rows are separated by newlines.

The following is a simple example of a CSV file with two columns and four rows:

0,0
1,1
2,10
3,11

When a separator needs to be part of a value, the value may be wrapped in double quotes ("). The data represented in this example is identical to the previous:

"0","0"
"1","1"
"2","10"
"3","11"

Double quotes may be used within a value by preceding them with more double quotes.

For example, the value "No Entry", the sign said. can be encoded as """No Entry"", the sign said."

The value " can be encoded as """".


The first row of the table may be field names but this is not specified by the CSV format. The presence of such depends on the author's decision or software that created it.

Support for CSV Files in Scratch

What Scratch does when a well-formed .csv file is imported into a list

Scratch supports importing a CSV file into a list. To do so, right-click the list monitor, select "Import", then select a file on your computer. Only one column can be imported into a list. If the file is detected to have multiple columns, Scratch will ask which column should be imported.


See Also

Cookies help us deliver our services. By using our services, you agree to our use of cookies.