Opening CSV or Text Files as Calc Spreadsheets--and Vice Versa
When I worked at Sun, there were a few
things people always asked, that were hard to figure out.
- How do you print the same rows or columns on every page of a spreadsheet? (See this post. )
- How do you print handouts for a presentation? (See this post.)
- How do you get a blank paragraph line above a table that's at the top of a document? (You now simply have to press Return in the upper left cell of the table.)
Another very common question was:
How in the world do you open a perfectly good .txt or .csv file (comma-separated values) in a spreadsheet? Basically, you've got data in rows and columns, but separated by tabs or commas rather than columns in a spreadsheet, and you want it in a spreadsheet. Comma-delimted files are a common way to get data out of a spreadsheet or database and into another.
The trouble is, in OpenOffice.org, if you just choose File > Open, the .txt or .csv file opens in Writer. Not what you want.
Here's how to open it in a Calc spreadsheet.
Opening a .txt or .csv File in a Calc Spreadsheet
1. Start OpenOffice.org. You can be in Writer, Draw, Calc—it doesn't matter.
2. Choose File > Open. (Click the picture to see a larger version of it, if you want.)
3. In the File Type list, select Text CSV. It's about a third of the way down the list of types, or you can click in the file type list and press T four times.
4. The window should now look like this, so just click Open.
5. You'll get a window where you specify how the file was created: what separates the data into columns, etc. (Click the picture to see a larger version, if you want.)
6. Also in the same window, if you have date-format data or other formats you want to specify, you can do that column by column.
7. When you're done, just click OK. You'll see the data in a spreadsheet.
8. You'll want to save it as a spreadsheet at some point. Choose File > Save As and select the standard OpenSpreadsheet .ods format.
9. Click Save.
Saving a Calc Spreadsheets as a .txt or .csv File
1. Let's say it's the other way around—you've got a spreadsheet and you want it to be in a nice neutral .txt or .csv file. Be sure the file is open.
2. Choose File >
Save As and select the same Text CSV format in the file format list.
This time you can click T just once.
3. Click Save.
4. You'll probably see this message. Click Yes.
5. In the next
window, specify the type of character you want to separate columns,
commas or tabs or another character.
6. Click OK; you're done.







Thanks for this detailed article
As CSV file extensions are usually customized by "users", depending on their origin, one often need to adapt OOo so that it recognize them automatically as CSV files
Here are the instructions to setup an extension to be opened as a CSV file by default
http://blogs.nuxeo.com/sections/blogs/laurent_godard/2006_02_24_enhancing-ooo-calc-csv-file-recognition
Laurent
Posted by: Laurent Godard | February 28, 2006 at 12:52 AM
Ok, here's a question. How do I convert a single column of address into a .csv file.
i.e
Bill Blogs
31 Smith St
Maryville
Illinois 23432
John Sneddon
23 Gool St
Karaba
Mandalay 23442
Into
Bill Blogs , 31 Smith St, Maryville, Illinois 23432
Either that or how do I automate a whole column of addresses vertically into a separate column for each address component which I can then make into a csv.
Posted by: graeme sprigge | March 15, 2006 at 03:56 PM
How do I convert a single column of
addresses like this one below into .csv file. Owner: Sue S Address:123Main Street Kalamazoo,Mi.12345 How do I eliminate the titles "owner","address"
Posted by: timothy rank | June 09, 2006 at 10:48 PM
Hi Timothy,
So the text has titles, like this?
Owner Address
Sue 123 Main
Bob 406 Pearl
I'm not sure why you'd want to eliminate them since they're useful and not actually included in the data if you create a database from this.
Once you create the spreadsheet, you can just delete the row that the titles are in.
Posted by: Solveig | June 10, 2006 at 06:32 AM
Hi Graeme,
You've got a bit of a tough situation there. If you want to just search for carriage returns and do it manually, see this entry.
http://openoffice.blogs.com/openoffice/2005/12/finding_and_rep.html
If you possible, figure out something that all the first, second, or third lines have in common (like "St."), search for it along with the carriage return, replace it with itself plus a space.
Posted by: Solveig | June 10, 2006 at 06:35 AM
thanks for this, v.helpful :D
Posted by: Simon | July 15, 2006 at 03:30 AM
I followed the instructions upto step 4. However I do not get the window as displayed in step5, I get a window with 3 fields - an import into Writer.
Thanks
Regards
Herby
Posted by: Herby | November 09, 2006 at 07:16 AM
this worked perfectly for me
Posted by: Dave Satwicz | March 06, 2007 at 02:04 PM
Thanks,
Your information was really helpful and worked perfectly for me
Posted by: Lino Alphonso | May 12, 2007 at 11:59 AM
hi thank u! uv been great help
and may i say ur beatiful too
Posted by: tomer | July 05, 2007 at 12:30 PM
Thanks very much for your help. I'm not a big Microsoft fan so I picked up OpenOffice.
I never needed a spreadsheet program all that much until recently. I had always fumbled around with excel or found someone to help me get a basic thing done when needed.
Your tips have helped me make the connections between what I did know in excel and how to use and surpass that in the calc program from Open Office. Thanks.
Posted by: Jeremy Kneebone | February 19, 2008 at 03:57 PM
First of all, thank you very much for your helpfull infomation.
Even though I'm not able to open the database of my monthly calls that I download from my mobile company account;
It works fine with excel but not with Openoffice.
If you want I can send it.
Bye, Gianni
Posted by: gianni | March 17, 2008 at 04:07 AM
Hi Gianni,
What type of database is it that you download? Text csv, Access, spreadsheet, ?
Solveig
Posted by: Solveig | March 17, 2008 at 11:14 AM