Perspectives on economic behaviour
  • Assignment 1
    • Data analysis
    • Discussion
    • Rubric
  • Assignment 2
    • Data analysis
    • Report writing
    • Rubric
  • General
    • Referencing
    • CSV files
    • Feedback

Introducing CSV files

Getting started with data
Introducing CSV files

When downloading the data from Our World in Data for assignment 1 (or any datasets I supply), you will discover the data is stored in a CSV format. For some of you, this is the first time you will encounter such files.

What is a CSV file?

CSV (comma-separated values) is a standard text-based data format, which — as the name suggests — uses commas to split data into variables (columns), where each new line in the file is a new observation (row). Variations of CSV can split on tabs, semi-colons or any other character.

While a well-established format, Microsoft Excel does not always import CSV files nicely. Sometimes when opening a CSV in Excel, you will see the rows of text unseparated. If this occurs, you need to specially import the file using the options under the ‘Data’ tab. Instructions can be found on Microsoft’s support website.

Why not just use an Excel spreadsheet?

Excel file formats are a combination of both data storage and presentation (you can format text or add colours), whereas CSV files are plain text. For this reason, CSV files are well suited for use across different systems, including packages such as R. (R can still read Excel spreadsheets, but will discard any formatting.)

A bigger problem is that Excel spreadsheets have built-in limitations around size. While not a problem for this exercise, if you work with ‘big data’ with millions of observations — for example, census data — Excel is likely to be too restrictive for your needs. Microsoft reports that an Excel worksheet cannot be any larger than 1,048,576 rows or 16,384 columns, with the format and software subject to several other limits.

NF SDU

Nick Ford
University of Southern Denmark
Department of Economics

© 2025 Nick Ford. All rights reserved.