How To Create A CSV File

Table of contents:

How To Create A CSV File
How To Create A CSV File

Video: How To Create A CSV File

Video: How To Create A CSV File
Video: How to make a CSV file 2024, April
Anonim

CSV files are designed to store tabular data in plain text file format. To open such a file, no special program for working with tables is required; any simple text editor is enough. This format is often used by all sorts of scripts to store small amounts of data.

How to create a CSV file
How to create a CSV file

Instructions

Step 1

Use the simplest text editor (like Notepad) to "manually" create the CSV file. If you need a file that does not contain any data, then just save a blank document with the csv extension - for example, data.csv.

Step 2

Separate the contents of adjacent table columns with a comma if you need to put some table data in the file. The very name of this format (CSV - Comma Separated Values) is translated from English as "comma separated values". However, it is more convenient and therefore more commonly used to separate the values with semicolons. This is due to the fact that in most non-English speaking countries, it is customary to use a comma as a separator between the integer and fractional parts of real numbers.

Step 3

Place only one row of tabular data per line in the CSV file. That is, the line terminator is a line separator for the table contained in such a file.

Step 4

Use a spreadsheet editor if you don't want to create the CSV file yourself. Most spreadsheet programs can read and save data in this format. For example, you can use an office application Microsoft Excel 2007. After creating (or opening) a table in it that you want to save to a CSV file, click the large, round Office button in the upper left corner of the editor window. In the menu that opens, go to the "Save As" section and select the bottom item - "Other formats". This menu item is assigned a "hot key" F12 - you can use it.

Step 5

Expand the drop-down list "Files of type" and select the line "CSV (comma delimited)". Then in the "File name" field, enter a name, select a storage location and click the "Save" button.

Step 6

Answer affirmatively (OK and Yes buttons) to the questions Excel asks twice before saving the file. In this way, the editor will warn that the CSV format does not support the ability to format text, use "books" and "pages", formulas in cells and other options available in the native formats of this spreadsheet editor.

Recommended: