Bug 35639 - "Insert > Sheet From file" cannot open text files without .txt extension on filename
Summary: "Insert > Sheet From file" cannot open text files without .txt extension on f...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.3.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-24 15:33 UTC by delcypher
Modified: 2012-01-24 03:25 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Test kit, see Comment 1 (30.85 KB, application/x-zip-compressed)
2011-03-24 23:29 UTC, Rainer Bielefeld Retired
Details
Screenshots and the offending text file (928.44 KB, application/zip)
2011-03-25 02:42 UTC, delcypher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description delcypher 2011-03-24 15:33:03 UTC
Steps to reproduce:
1. Create sample text file
#[Steps] [time(seconds)]
1500 0.64
1500 0.64
1500 0.64
2000 0.85
2000 0.87
2000 0.85
2500 1.07
2500 1.07
2500 1.07

called "sample.log"

2. Start LibreOffice calc
3. Go to Insert > Sheet From file
4. The file browser appears select the file "sample.log"

5. The "From File" radio button will be selected but nothing other than a whitebox is shown below and the "ok" button is greyed out.

This is BAD because it provides no user feedback at all that it has failed to open the file which is perfectly valid text file. 

If the the file has a ".txt" extension then LibreOffice calc will open the file as expected but WHY!? OpenOffice can cope with text files without a .txt extension so why can't LibreOffice? Shouldn't it be using the file metadata and NOT the .txt extension?
Comment 1 Rainer Bielefeld Retired 2011-03-24 23:23:05 UTC
NOT reproducible with "LibreOffice 3.3.2  – WIN7  Home Premium  (64bit) German UI [OOO330m19 (Build:202 / tag 3.3.2.2)]" and self created source.log documents from source.ods (similar to table in report, but not identical, only integer numbers) with comma and also blank as separator).

Linux specific? 

@delcypher@gmail.com:
It's not a good idea to type such word art tables instead of attaching a sample document.

May I ask you to read  hints on <http://wiki.documentfoundation.org/BugReport> ?
Then please:
- Attach a sample document
- Attach screenshots with comments (you can add information using LibO DRAW
  and then attach your screenshot with comments as PDF) if necessary
- Contribute a step by step instruction containing every key press and every 
  mouse click how to reproduce your problem
- add information 
  -- how you created your sample.log
  -- and why do you believe it's unexpected
  -- concerning all related stings in import dialog
  -- concerning your OS distribution, exact version)
  -- concerning your LibO localization (UI language, document language)
  -- how you launch LibO
  -- how you opened target document
  -- everything else crossing your mind after you read a.m. URL

Can you please file Bug reports with status UNCONFIRMED if your are not absolutely sure that you contributed all required background information and that the problem will be reproducible with information you can provide? 

Can you please also test my source documents from attached test kit and report your results?

Thank you!
Comment 2 Rainer Bielefeld Retired 2011-03-24 23:29:09 UTC
Created attachment 44806 [details]
Test kit, see Comment 1
Comment 3 delcypher 2011-03-25 02:42:01 UTC
Created attachment 44814 [details]
Screenshots and the offending text file
Comment 4 delcypher 2011-03-25 02:56:27 UTC
Here is some additional information:
OS: Arch Linux (Linux 2.6.37-ARCH #1 SMP PREEMPT) 32-bit
Desktop: Xfce 4.8.0
LibreOffice version: LibreOffice 3.3.2 OOO330m19 (Build:202) 3.3.2.2 ArchLinux build-1
Arch Linux package: extra/libreoffice
glibc Locale: en-gb
Document Language: English (UK)
User Interface: English (USA)

See attachment ("Screenshots and the offending text file") for screenshots (png files) and ASCII text file "125-125-times.log"

Steps to reproduce (more thorough)
1. Start LibreOffice Calc through desktop's program menu (see screenshot-1)
2. You will now be in a blank spreadsheet document in LibreOffice Calc. Now click the following menu "Insert -> Sheet From file" (see screenshot-2)
3. You will be presented with a file browser. Select the file "125-125-times.log" and press the "Open" button (see screenshot-3).
4. You will now see an "Insert Sheet" window. Notice that the white box beneath the "From File" radio button is blank, i.e. nothing was imported. Consequently the "Ok" button is greyed out (see screenshot-4).

If now the text file is renamed to "125-125-times.log.txt" and steps 1 & 2 are repeated then do.
5. You will be presented with a file browser. Select the file "125-125-times.log.txt" and press the "Open" button (see screenshot-5).
6. You Will now see a "Text import" window (see screenshot-6). Press the "Ok" button.
7. You will now see an "Insert Sheet" Window (see screenshot-7). Notice how the whitebox below the "From File" radio button is no longer blank and that the "Ok" button is no longer greyed out.

-- Why the behaviour is unexpected.
LibreOffice should be able to recognise that the file "125-125-times.log" is an ASCII text file and do a "Text import". At the very least it should inform the user that it doesn't recognise the file "125-125-times.log" instead of just of doing absolutely nothing!

-- how I created your sample.log
The file is produced by a bash shell script, the details are not important. The ASCII text file is a UNIX text file and NOT a 
DOS text file.

@Rainer Bielefeld 
I've tried your test kit.
source.csv -> "Text Import" window appears and imports successfully.

source.log -> No "Text Import" window appears and I'm left with the "Insert Sheet" window as in screenshot-4. So Importing fails!

source.ods -> "Insert Sheet" window shows the sheets of the file "source.ods" and imports them successfully.

source.sxc -> "Insert Sheet" window shows the sheets of the file "source.xsc" and imports them successfully.

source.txt -> "Text Import" window appears and imports successfully.

source.xls -> "Insert Sheet" window shows the sheets of the file "source.xls" and imports them successfully.

sourceiwthblankseparator.log -> No "Text Import" window appears and I'm left with the "Insert Sheet" window as in screenshot-4. So importing fails!

sourcewithreals.csv -> "Text Import" window appears and imports successfully.

sourcewithreals.log -> No "Text Import" window appears and I'm left with the "Insert Sheet" window as in screenshot-4. So importing fails!

sourcewithreal.ods -> "Insert Sheet" window shows the sheets of the file "source.xls" and imports them successfully.

So as you can see every file with a ".log" file extension failed. This isn't very good behaviour.

Thanks.
Comment 5 Friedmann Bruno 2011-04-05 02:28:44 UTC
This pb appear also on windows : XP32 SP3 and WIN7 64bits SP1
LibreOffice 3.3.2 build 202

We have lot's of .log file (ansi encoding) given by mesureament instruments.
Most of them have extended charcode like à ö é etc.

If the file is named .log, writer import it directly without offering the text import dialog box. In that case no conversion is done, and the import is wrong.
all extended chars are missing or replaced by wrong one.

Now if we rename the file .log as .txt, then the import is done automatically, without asking anything (No filter dialog box). And all charset are correctly converted.
Comment 6 Friedmann Bruno 2011-04-05 02:32:34 UTC
Otherwise : tested on Ubuntu build 3.3.2 and openSUSE 11.4 Loo 3.3.2

Whatever the extensions of the file (.txt, .log), the import dialog text box is proposed to the user. 
So the selection of the right encoding is manually done, and everything works as expected.



----------------------------------------------------
Under windows, another thing to be noticed.

If the .log file content is converted to utf-8 before opening with Loo, then the import is right.
Comment 7 Friedmann Bruno 2011-04-05 02:52:00 UTC
Latest precision : 

Under Windows was working correctly (present the text import filter dialog box) with openoffice 3.2.1 & oracle 3.3.0

Seems we get a regression somewhere in Loo
Comment 8 Björn Michaelsen 2011-12-23 13:55:26 UTC
Replace whiteboard status "UNCONFIRMED" with a move to status "NEEDINFO" for unassigned new bugs.
Comment 9 sasha.libreoffice 2012-01-24 03:25:27 UTC
not reproducible in master of 24 jan 2012 on Fedora 64 bit
Change status to worksforme
Please, if problem remains, change status to Reopened