Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a file that is formatted as a .doc, but Nautilus and LibreOffice insists that it is a .txt. Both precise and Ubuntu 12.10 are that way, but Google Docs can convert it (after playing with it).

enter image description here

enter image description here

enter image description here

share|improve this question
    
It opens, it just reads it as a text/plain document, not as a MS word doc. Removed the +'s, no difference. –  jrg Aug 24 '12 at 14:17
    
could you try my edit @jrg . Damn, I need to know the answer :X :X –  Rinzwind Aug 24 '12 at 14:28
    
@Rinzwind I'm stupid, it's this thing. listarchives.libreoffice.org/global/users/msg22140.html –  jrg Aug 24 '12 at 14:52
add comment

4 Answers

To check if 'extension' mime type exist:

grep 'extension' /etc/mime.types

To create new mime type:

  1. Open /etc/mime.types with text-editor(with root privileges)

    gksudo gedit /etc/mime.types

  2. Add extension to /etc/mime.types in following format:

    text/extension extension

For more info click here

share|improve this answer
add comment
  1. In Nautilus, right-click on any file with the desired filetype or extension, choose Properties from the context menu.
  2. In Properties click on the Open With.
  3. Select an application for the given filetype (writer I asssume). All files with the same extension will now be opened with this program by default.

enter image description here

You can do this manually too

  • /usr/share/applications/defaults.list holds the defaults (ie. system wide associations).
  • ~/.local/share/applications/mimeapps.list holds user specifics.

By the way: I assume you have software installed (ie. LibreOffice) that can open doc files?


From the comments and images added:

  • it could be that the file is corrupt. What a file is is based on the 1st byte of a file (and not the extension as Windows does). What you could do is set .txt files to open with Writer (just temporary) and see if it then does open and then save it under another name. Then reset opening txt to Gedit or what it was before.
share|improve this answer
    
Nope. Not that simple. - i.imgur.com/n7Fuy.png –  jrg Aug 24 '12 at 14:01
    
i.imgur.com/M9X1K.jpg –  jrg Aug 24 '12 at 14:06
    
hey, it takes time to take good lookin' screenshots! ;) only shows the rest of the libreoffice suite. - i.stack.imgur.com/CXMsd.png –  jrg Aug 24 '12 at 14:09
add comment

Could be something as simple as a mangled/intentionally changed header. Here's what the MS Word first 2 chunks looks like in a couple of documents I just checked:

D0 CF 11 E0 A1 B1 1A E1

You could MAKE A BACKUP and try changing the first several bytes to that signature and see if it doesn't at least TRY to open as the right thing.

Generally, file can look at this area:
enter image description here
And tell the file-type. If it's detecting it wrong, either it actually is a text file renamed to doc or the header got borked.

share|improve this answer
    
Excellent @aking1012 +1 O –  Rinzwind Aug 24 '12 at 14:39
add comment
up vote 0 down vote accepted

The answer was right in front of me, after a fashion.

http://listarchives.libreoffice.org/global/users/msg22140.html

The mailing list link above details how it's actually a mht document, which is not supported by LibreOffice.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.