Open txt files in Calc

Dear Ladies & Gents:

I need to be able to open .txt files in Calc. This function is available in OpenOffice [Text CSV (*.csv; .txt)] but not in LibreOffice.
The Files I need to open are .txt formatted invoices. With the OO function I can pick the separation option (fixed width, tab, comma, etc.).
I went through the Calc functions in LO and I could find only the [Text CSV (
.csv)] one.
Please help.
Thaks,
Manrico.

Question about “why can’t you?” at Why does the Text CSV filter not permit *.txt extensions? . These answers are about “what’s the workaround”.

Hallo

This Import-dialog is also available through →Sheet→Insert sheet from file……

Actually, the function to open txt files as CSV is still there; it’s just Open dialog’s filter settings were changed. Now, CSV filter here only sees .csv extension. So, a workaround is to open such files in two stages:

  1. Select required file using “All files” or “Text (*.txt)”, so that the file name appears in the File Name input box;
  2. Now select the “Text CSV (*.csv)” filter, (the file name stays in the File Name) and click Open.

Another workaround is to create a shell shortcut (.desktop/.lnk) with command line that would explicitly specify module or filter to use. E.g., something like this:

soffice --calc

or

soffice --infilter="Text - txt - csv (StarCalc)"

If you drag a file (e.g., a TXT) to such a shortcut, LO should open it using selected module/filter, and so make it more convenient to you if that’s a repeated task.

Of course, just renaming files to CSV would also help, but that’s not a solution, but just another (not always acceptable) workaround.

The workaround to select the required file first, then select the “Text CSV (*.csv)” filter, does not work for me in LibreOffice 5.4.1 or 5.3.4 on Mac OS X. On the Mac application, there is no File Name input box, there is a list box with the file names. I can click on the required file, and that line in the list box is highlighted. But when I select the “Text CSV (*.csv)” filter, LibreOffice clears this selection and greys out any list box row for a file lacking a .csv extension.

If I drag and drop the .txt file onto Calc spreadsheet I get the option the separation options menu (fixed width, tab, comma, etc.).

If you cannot do it, upload a dummy .txt file so we can try to do it.

LibreOffice version 5.2.5.1.

Here’s the workaround I use with LibreOffice 5.4.1 and 5.3.4 on Mac OS X 10.11.6.

  1. Create a blank spreadsheet, or otherwise arrange to have a spreadsheet as the top document.
  2. File → Open . A file selection dialog appears.
  3. Do not select any File Type. Just click on the tabbed-text file, and click Open. The Text Import dialogue appears.
  4. Select “Tab” for field delimiter, and continue.

Mike Kanagasaki’s answer may well work on Linux and/or Windows versions of LibreOffice, but it does not work for me on Mac OS X. This may be a consequence of the standard File Open dialogues having different behaviour on different systems.