Why txt file opens in writer instead of calc

I have MS Windows 10 and I want to open a text file *.txt in libreoffice calc
for this I choose a file in exploere → open with → libreoffice calc

But! The file is open to libreoffice writer

I think that in Libreoffice there is a built-in definition of the type of file or something.

How I can this be turned off?

P.S. in MS Office 2003 txt file successfully open in excel

The same happens to me (LibreOffice, on Windows 10).

As a workaround, open the file from within Calc; or change the file extension to .csv.

becasue TXT is a text file. Open Calc and try open the TXT file using File-Open menu item

Alternative strategy:

  1. In Explorer hold down Shift, right-click the file and select Copy as path (about 60% way down the menu, only appears if Shift held down).
  2. Open Calc, click File > Open and paste the path into the Open dialogue. Click OK.

That works also in Windows 11 (asked some other to test).

1 Like

Good point. My computer is threatening Windows 11 upgrade.
After 20 years of holding down Shift, it would be nice if “Copy as path” just appeared in the Windows 11 Explorer right-click menu.

hello I know that if open the libreoffice calc and choose to open *.txt another file from it, it will open.
I can also open a text file in notepad and copy content to calc, that also works.

but why if i open a text file in libreoffice calc it opens in libreoffice writer

Am I the only one who thought about this and no one found a solution?
It is obvious that the libreoffice has a mechanism that determines which expansion to open than what. but where are its settings?

As @kompilainenn says, because it is a text file so it opens in Writer.
That fact that Calc can open the text file and use any separators present in the file to create a table doesn’t stop the file from being plain text, like a Readme.txt file
LibreOffice is a monolithic program, Calc, Writer and the others share components. LibreOffice inspects the file and selects the suitable sub-program in which to open the file. This can also be a useful ability. If the choice doesn’t suit then you have the option of opening the file from the sub-program you wish.

This is what I want to achieve by choosing the application “C:\Program Files\LibreOffice\program\scalc.exe”

however, instead of scalc.exe , swriter.exe is executed

it is obvious that there are settings in the libreoffice which type of file to open with which program.

There are files like this https://github.com/LibreOffice/core/blob/master/solenv/inc/mime.types
In the core of the program.

As I remember now where this _csv.txt-files in my archives originate I would suggest to rename your files to .csv wich can be opened in Calc without problems.

AFAIK you can’t open .txt in Calc by right-click in Explorer. You have to use one of the other methods given.

i did an experiment:
launched CMD, and execute this command:
C:\Program Files\LibreOffice\ program\ scalc.exe c:\testdir\testfile.txt

and result the file opened in libreofficecalc

it turns out that when I run “open with …”, even if I select scal.exe, another program is launched.
I think this behavior is related to the Windows settings

maybe someone knows where this is configured?

You’ve called Calc and then passed it a file name to open. That is the same as opening Calc and then clicking File > Open.

The selection of program happens within LibreOffice. If you rename a spreadsheet extension from .ods to .odt and double-click it it will open in Calc, not Writer. LibreOffice peeks inside and says this is a spreadsheet so it will open in Calc.

@Wanderer suggestion to rename from .txt to .csv will be a permanent fix for that file as there is an exception for that file extension.

If you open the sendto folder (in win10 click on search and type in sendto) then put a shortcut to Calc in that folder you will be able to right click on a text file and in the menu that pops up choose send to Calc. Works perfectly.