Importing Tabular Data : CSV Files
If the various OOo Calc forums are an indicator of what gives Calc users the most grief, then importing data into Calc via CSV (coma separated values) files is up there with charting as one of the most error prone tasks.
Before you can perform data analysis with OOo Calc, you first need to import the data into the program. Supposedly, one of the more straightforward mechanisms for doing so is via CSV files. These are text files whose files have defined separators tab, comma, semicolon etc) that allow easy mapping from the CSV file into the cells of the spreadsheet.
In this tutorial, we will import some French population data into OOo Calc. The popdata.csv file is listed below.
Alsace, ALS, Strasbourg, 8280, 1566048,1624372, 1734145
Aquitaine, AQU, Bordeaux, 41308, 2656544, 2795830,2908359
Auvergne,AUV, Clermont-Ferrand, 26013, 1332678 ,1321214, 1308878
Basse-Normandie, BAS, Caen, 17589, 1350979 ,1391318, 1422193
Bourgogne, BOU, Dijon, 31582, 1596054 ,1609653, 1610067
Bretagne ,BRE, Rennes, 27208 ,2707886 ,2795638, 2906197
Centre, CEN, Orléans, 39151 ,2264164, 2371036, 2440329
Champagne - Ardenne, CHA,Châlons-sur-Marne, 25606, 1345935, 1347848, 1342363
Corse, COR, Ajaccio, 8680 ,240178, 250371, 260196
Franche-Comté, FRA, Besançon, 16202, 1084049, 1097276, 1117059
Haute-Normandie, HAU ,Rouen, 12317, 1655362, 1737247, 1780192
Île-de-France, ILEk, Paris, 12012, 10073059, 10660554, 10952011
Languedoc - Roussillon, LAN ,Montpellier, 27376 ,1926514, 2114985, 2295648
Limousin , LIM, Limoges, 16942, 737153, 722850, 710939
Lorraine, LOR, Nancy, 23547 ,2319905, 2305726, 2310376
Midi - Pyrénées, MID, Toulouse, 45348, 2325319, 2430663, 2551687
Nord - Pas-de-Calais, NOR, Lille, 12414,3932939 ,3965058, 3996588
Pays-de-la Loire, PAY, Nantes, 32082, 2930398, 3059112, 3222061
Picardie ,PIC, Amiens, 19399 ,1740321, 1810687, 1857481
Poitou - Charentes, POI, Poitiers, 25810, 1568230, 1595109, 1640068
Provence - Alpes - Côte d’Azur, PRO, Marseille, 31400, 3965209, 4257907, 4506151
Rhône - Alpes, RHO, Lyon, 43698, 5015947, 5350701, 5645607
From the File-Open dialog, we select File type TEXT CSV (*.csv *.txt) We then select the text CSV file we wish to import.

The Text Import dialog opens - which will give you a preview of your imported data. The default separator is comma, and fixed field width is unselected, so we do not need to change any of the settings in this window. Click OK

Now you can inspect the imported text data, making any formatting modifications that you deem necessary. Note that the width of the columns have been optimally sized by OOo Calc.

When it comes time to save your data and/or exit the OOo Calc application, you will be given the option of saving as a CSV file. If you do opt to save as a text CSV file, you will lose any formatting modifications that you made to the imported data.

August 2nd, 2007 at 9:25 am
I’d like to be able to use the text import function on data that I’ve copied and pasted into Calc without the intermediate step of putting that data into a file and saving it and then importing it. In Excel, there is the function Data > “Text to Columns” that allows one to specify delimiters to break up a row of text into several columns. Is there anything similar in Calc?
August 20th, 2007 at 5:23 pm
I second that comment, took me a while to find this page (via tims comment) to learn how to do it.
November 24th, 2007 at 4:50 pm
Hi there…Man i love reading your blog, interesting posts ! it was a great Saturday