Page 1 of 1

[Solved] Opening Text File to Convert to Spreadsheet

Posted: Fri Jan 18, 2008 4:51 pm
by barryaf
I am trying to open a text file that has space delimited data in it but after going to 'open' in calc and selecting the file, it opens the text file in writer. If I open the file from command line (scalc file.dat) it gives me the 'text import' tool. How do I get the 'text import' tool to open like it does with Microsoft Excel by selecting 'open' from the 'file' menu?

Re: Opening Text File to Convert to Spreadsheet

Posted: Fri Jan 18, 2008 5:59 pm
by Villeroy
Change the file name extension to csv.

Re: Opening Text File to Convert to Spreadsheet

Posted: Fri Jan 18, 2008 6:03 pm
by probe1
no need to change the file name:

go to directory where the file is located, choose Text CSV (*.csv; *.txt) as filter in OPEN dialogue and type file name, hit ENTER.

Re: Opening Text File to Convert to Spreadsheet

Posted: Fri Jan 18, 2008 6:20 pm
by acknak
There are a couple of ways to do this.

One is:
1) File > Open
2) Select your file "file.dat"
3) Use the "File Type" drop down to select "Text CSV" (scroll down the list; it's in with the other spreadsheet formats)
4) OK

That will specify a file name and a file type that opens in Calc.

However, I don't recommend that you use this method.

When you File > Open any file in OOo, OOo edits that file--just like if you opened a spreadsheet document. Calc will behave exactly as if you were working on a spreadsheet, but when you save the file, it will only save CSV text not a full spreadsheet. If you forget that you are working on a CSV file and not a spreadsheet file, you can lose work.

I prefer this method:
1) Insert > Sheet From File
2-4) same as above

That brings in the data but keeps the working document as a full, normal spreadsheet.

Re: Opening Text File to Convert to Spreadsheet

Posted: Fri Jan 18, 2008 6:31 pm
by huw
acknak wrote:There are a couple of ways to do this.

One is:
1) File > Open
2) Select your file "file.dat"
3) Use the "File Type" drop down to select "Text CSV" (scroll down the list; it's in with the other spreadsheet formats)
4) OK
5) Save as ODT
acknak wrote:When you File > Open any file in OOo, OOo edits that file--just like if you opened a spreadsheet document. Calc will behave exactly as if you were working on a spreadsheet, but when you save the file, it will only save CSV text, not a full spreadsheet. If you forget that you are working on a CSV file and not a spreadsheet file, you can lose work.
CSV can also only cope with one sheet, so all sheets but the current one will be lost when you save.

Re: Opening Text File to Convert to Spreadsheet

Posted: Fri Jan 18, 2008 8:08 pm
by barryaf
Thank you very much for all the suggestions. They are very helpful.

Re: [Solved] Opening Text File to Convert to Spreadsheet

Posted: Sun Jan 20, 2008 6:39 pm
by eikelein
Sorry for chiming in here after the "Solved" tagging.
But both methods described here DO NOT WORK for me at all. :cry:
No matter which way I take OO always opens the file in Writer and Writer can't save it as .csv.

OO 2.3.1, Win XP SP2

Re: [Solved] Opening Text File to Convert to Spreadsheet

Posted: Sun Jan 20, 2008 9:43 pm
by kingfisher
Now that the thread is tagged as solved, you would improve your chances of getting help if you start a new thread, eikelein.

I suggest you give more details of the file you want to open in Calc and, if it's not sensitive, upload it.

The need to open such files in Calc has been the subject of various issues. The method suggested by acknak is the official workaround. It's time consuming if you need to open a number of such files.

Are you not able to create a new spreadsheet and use Menu: Insert >Sheet from file?

Re: [Solved] Opening Text File to Convert to Spreadsheet

Posted: Mon Jan 21, 2008 1:37 am
by acknak
These methods do work, we just have to figure out why they're not working for you.

There's no problem to continue a "SOLVED" thread. In fact, the solution to your side of the problem may help someone else, so don't worry about it.

Please describe exactly what you're trying to do, and what you did, and what happened when you did it---step by step: what your data looks like (give a sample if you can), what menus you used, what keys you pressed, all that stuff.

PS: Here's a sample: Starting from a Writer window, I opened a programming code source file (text) named "gauge-new.pl" in a Calc spreadsheet:
Image
You do have complete control over where the file opens, it's just not terribly convenient.