Monday 21 January 2013

How to create a CSV file??

How to create a CSV file??

CSV file:

                  A comma-separated values (CSV) file is any file containing text that is separated with a comma, but can also be a file separated with any other character. To create a CSV is as simple as creating any text file and can be created in any text editor, however, is often created in a spreadsheet program such as Microsoft Excel or Open Office Calc. Below are the steps on how to create a CSV file using a text editor such as
1) Notepad
2) Microsoft Excel
3) Open Office Calc and 
4) Google Docs.

Notepad or text editor:

           to create a CSV file in a text editor open a new text editor program, such as Notepad. Once open write the text data you wish the file to contain and separate each field or column of data with a comma and each row with a new line.
Title1,Title2,Title3
one,two,three
example1,example2,example3

EXAMPLE:
      If you were to create a text file with the above data, and save it with .csv extension , each column is created by each comma and each row is created by each new line. Therefore, the above data if opened in a spreadsheet program such as Microsoft Excel would create a table similar to the below example.
Title1
Title2
Title3
one
two
three
example1
example2
example3
If the data you're planning to use in your CSV file already has comma's, such as an address; it's easier to use a different delimiter to separate each of the values. 
Microsoft Excel
Open Microsoft Excel and the file you wish to save as a CSV file. For example, below is the data contained in our example Excel worksheet.


Item
Cost
Sold
Profit
Keyboard
$10.00
$16.00
$6.00
Monitor
$80.00
$120.00
$40.00
Mouse
$5.00
$7.00
$2.00


Total
$48.00



Once open, click File, choose the Save As option, and as the Save as type: select the CSV (Comma delimited) (*.csv) option.

Once saved, if you were to open the CSV file in a text editor, such as Notepad, the CSV file should resemble the below example.
Item,Cost,Sold,Profit
Keyboard,$10.00,$16.00,$6.00
Monitor,$80.00,$120.00,$40.00
Mouse,$5.00,$7.00,$2.00
,,Total,$48.00

Open Office Calc
Open Open Office Calc and the file you wish to save as a CSV file. For example, below is the data contained in our example Calc worksheet.
Item
Cost
Sold
Profit
Keyboard
$10.00
$16.00
$6.00
Monitor
$80.00
$120.00
$40.00
Mouse
$5.00
$7.00
$2.00


Total
$48.00
Once open, click File, choose the Save As option, and as the Save as type: select the Text CSV (.csv) (*.csv) option. Once saved, if you were to open the CSV file in a text editor such as Notepad the CSV file should resemble the below example.
Item,Cost,Sold,Profit
Keyboard,$10.00,$16.00,$6.00
Monitor,$80.00,$120.00,$40.00
Mouse,$5.00,$7.00,$2.00
,,Total,$48.00
Google Docs
Open Google Docs and the Spreadsheet file you wish to save as a CSV file. Click FileDownload as, and then select CSV (current sheet).


No comments:

Post a Comment