What are CSV files? And how do I deal with them?

This image is just for the preview, it has nothing to do with the post

So what are CSV files?

CSV stands for Comma Separated Values. It is a format best used for tabular data, rows and columns, exactly like a spreadsheet. A CSV file should have the same number of columns in each row.

From the top, comma (,), pipe (|), and semi-colon (;)

Wait, how come we can open .csv in a text editor? I can’t open my Excel files in a text editor

This is a great question and requires some diving into what files are.

Hmm okay, so how come I can open my .csv files in Excel too?

This is a feature of Excel. It makes .csv files easy to open and deal with. A lot of times, your computer’s default software to open .csv files is actually Excel.

This is our comma separated file (,). Opening it up in Excel parses it into cells automatically
This is our pipe separated file (|). Opening it up in Excel leaves it like how we saw it in the text editor

Ah, I see. So how do I parse other delimiters to cells in Excel?

Great question. There are two ways to do it, which share most of the same steps.

  1. Select the column with all the values. It should be only the first column. If your file has been opened in multiple columns then use method 2
Selected Column A
Do nothing and click on Finish
Our parsed columns
  1. Open a new Excel workbook
  2. Click on Data -> From Text. Select the .csv file you want to open and click Get Data.
Select the file you want to open

Okay, this is all cool. But how can I create CSV files?

There are two ways to create CSV files.

  1. Open up a new Excel workbook
  2. Write Name, Occupation and Notes in the first row
This is on a Mac. On Windows there will be a File Type dropdown
The file we saved in Excel opened up in TextEdit on Mac

Sweet, but what are these quotation marks around some of the values?

Glad you asked. This is the final piece of the csv puzzle. You will run into many cases when your values contain your delimiter.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Love Spreadsheets

Love Spreadsheets

Life is too short to work on spreadsheets. Let us do your spreadsheet work for you at lovespreadsheets.com