[SOLVED] Thunar sees both '.doc' and '.txt' as plain text files...

Hello,
I'm using Thunar as my file manager. However, it sees both '.doc' and '.txt' files as "plain text files".
This means that I can't make the .doc files open with OpenOffice and the .txt files open with a plaintext editor, because whenever I change the program association of one, the other changes.
How to fix that? (looks like a MIME-type issue).
Thanks.
Last edited by Renan Birck (2009-08-14 15:57:05)

DaVince wrote:Open /usr/share/mime/globs and /usr/share/mime/globs2, find the lines that assign *.doc to the plaintext mime type, and remove them. Restart Thunar, problem solved.
Finally it works. Thanks!

Similar Messages

  • Writing the hashtable content (both keys and values) into a text file

    Hello,
    I have a hashtable which have some keys and respective values in it. Now I want to write all thoses content into a text or log file. Can anyone please tell me how to write it.
    thanks,
    chaitanya

    Properties is a subclass of Hashtable. It'll probably work just fine as a drop-in replacement.
    Otherwise...if all keys and values are text, then loop through the Entry objects in the Map in question (Hashtable is a Map, and you probably shouldn't be using Hashtable anyway), or loop through the keys and grab the corresponding value for the keys. Read the API docs for java.util.Map. It's pretty straightforward.

  • Reading and writing to a text file from an Applet

    I'm a novice java programming with very little formal programming training. I've pieced together enough knowledge to do what I've wanted to do so far...
    However, I've been unable to figure out how to read and write to a text file from an Applet (I can do it from a normal java program just fine). Here is a simple example of what I'd like to do (you can also look at it on my website: www.stat.colostate.edu/~leach/test02/test02.html). I know that there is some problem with permission/security but I'm not smart enough to understand what the error messages are telling or understand the few books I have. If anyone can tell me how to get this applet to work, or direct me to some referrences that would help me out I'd really appreciate it.
    Thanks,
    Andy
    import java.applet.Applet;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.io.*;
    public class test02 extends Applet {
    public Button B_go;
    public GridBagConstraints c;
    public void init() {
    this.setLayout(new GridBagLayout());
    c = new GridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    B_go = new Button("GO");
    c.gridx=1; c.gridy=0; c.gridwidth=1; c.gridheight=1;
    c.weightx = c.weighty = 0.0;
    B_go.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    print_stuff();
    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    this.add(B_go,c);
    public static void print_stuff() {
    try{
    File f = new File("test02.txt");
    PrintWriter out = new PrintWriter(new FileWriter(f));
    out.print("This is test02.txt");
    out.close();
    }catch(IOException e){**/}
    }

    I have almost the exact same problem, and I am in the same situation as you are with respects to the language.
    I am simply trying to create a file and output some garbage to it but my applet always spits back a security violation. I've tried eliminating the restrictions on the applet runner I use but I still get the error.
    My method:
    debug = new Label() ;
    debug.setLocation( 20, 20 ) ;
    debug.setSize( 500, 15 ) ;
    add( debug ) ;
    // output
    try
         OutputStream file = new FileOutputStream( new File( "" + getCodeBase() + "output.txt" ) ) ;
         byte[] buffer = { 1, 2, 3, 4, 5 } ;
         file.write( buffer ) ;
         file.close() ;
    } catch( Exception e )
         debug.setText( e.toString() ) ;
         Can anyone tell why this isnt working?

  • I have to average data of 1min and then log into text file

    For my application i have to average data of 1min and then log into text file. please guide me on this . To transfer the data i am using notifier.
    Prashant Soni
    LabVIEW Engineer

    hi prashant,
      Check this attachment..I just implemented my idea    in this one.
    Thanks and regards,
    srikrishnaNF
    Attachments:
    Example_VI_BD.png ‏12 KB

  • How do I find images in LR 2.4 (imported from CS4 Bridge) that have color labels already assigned In CS4 Bridge? I have set both Bridge and LR color labels text to match (eg Green for green, etc).

    How do you find images in LR 2.4 that have been imported from CS4 Bridge and have been assigned a color label in Bridge?  I have set both LR 2.4 and my CS4 Bridge to match the text for each color to be the same (eg. Green for green, etc), and the filter search in LR 2.4 shows that a label has been assigned, but I am unable to identify and locate the specific images in LR 2.4 that have had a color label assigned from CS4 Bridge.  I have tried to search via attribute, metadata, text, etc...Is it necessary to re-assign color labels all over again, image by image, in LR 2.4, or is there a way to automatically have the color labels assigned in CS4 Bridge be assigned and searchable to the images after they have been imported into the LR 2.4 catalogue from the Bridge program?

    JohnM.
    I closed both programs and re-imported photos and re-tried the action of having LR  read the XMP metadata from the CS4 files, and it seems to work now just fine...don't know why now and not before, but thanks much. Is there a way to have LR do this automatically upon import of images from CS4?  I tried to do this with an import metadata preset, but no luck.  It seems as if I can only do this once the images have already been imported into LR, and then to have to have LR read the metadata from the CS4 Bridge files.  thanks gain.

  • Use AppleScript or Automator (or both) to get Mail and add to a text file?

    Hello all,
    I'm sorry if this is a duplicate of a well-known topic, I tried searching and couldn't see anything.
    I'm behind a proxy at work that blocks any kind of webmail access, but I'd like to be able to check my email while on a break or something.
    I had the idea that I could use Automator or Applescript to check my mail, get the new messages and add the text to a textfile that I could host on my personal webserver that I use for family stuff.
    I've tried an automator workflow that seems to work while in Automator, but when I save it as an application, it won't even start Mail to check.
    I also thought of just leaving mail running, and have a rule that starts a script when new mail arrives, but I don't know enough about Applescript to do it.
    I don't want to confuse anyone with the details of my convoluted ideas, so I'll leave it at that.
    Is there a way to do this? I want mail to check the server, download the messages, new messages get their text appended to a text file that's stored in my webserver's directory (same computer) that I can access from the web, and have it repeat every 5 minutes or so.
    If I've left out a detail, let me know, and if I'm just stupid and there's an easy way to do this... be kind.
    Thanks!
    aeix
    iMac G5 2.0 GHz   Mac OS X (10.4.6)  

    It certainly is going in the right direction. I'm not all that versed in AppleScript, but it looks like that particular script is creating a new text file for every message processed.
    I would like to either create a specific text file if it doesn't exist, or append the text to the end of the file if it does exist.
    But like I said, definitely heading in the right direction!
    iMac G5 2.0 GHz Mac OS X (10.4.6)

  • Reading and Writing from a text file at the same time

    I know who to use the Scanner and PrintWriter to read from and write to a .txt file. But these are limited. How can I read and write at the same time? Such as open a file and change every third character or change every second word to something else and then write it back. I found this [http://java.sun.com/docs/books/tutorial/essential/io/|http://java.sun.com/docs/books/tutorial/essential/io/] but its a little over my head. Is this the only way to do it?

    wrote:
    You are using buffered reads and writes I would assume, right? Also, how do you think most programs handle this sort of thing? I don't believe I'm using buffering.
    My code looks something like this
    //...necessary imports
    //then
    Scanner inFile = new Scanner (new file("filename1.txt"));
    PrintWriter outFile = new PrintWriter ("filename2.txt");
    //then stuff like
    int x = inFile.hasNextInt();
    outFile.println(x);
    camickr wrote:If you are changing the data "in place", that is none of the data in the file is shifted, then you can use a RandomAccessFile.
    Otherwise, you've been given the answer above.What is RandomAccessFile? Is it what I have a link to? Basically what I do is I write a bunch of numbers to a txt file and then change the numbers I don't need anymore to 0. So say I had 0 1 2 3 4 5 6 7 etc. I would like to to open the txt file and change every second one to 0 so then I'd have only odd numbers and 0s.
    I looked at the documentation for RandomAccessFile and it seems like it might be what I need.
    Thankyou both for your help so far. I took a java course in high school and they only taught me one way to get data from text files and that is what I just showed you. So maybe this questions are really stupid. lol
    Edited by: qw3n on Jun 13, 2009 7:46 PM

  • How to get current month from filename and bulk insert from text file into table?

    I set up some dynamic SQL to help my bulk copy data from a text file to a table.  This works fine for files that come in every day; I get the previous day’s data, based on the file name that’s placed
    in the folder.  That’s why I’m using the ‘-1’.  The dates will look like this: '20140131', so I'm using type 112.
    declare @fullpath1 varchar(1000)
    select @fullpath1 = '''\\system.local\ms\london\FTP\' + convert(varchar, getdate()-1, 112) + '_INDEXPRICES_EOM.SPC'''
    declare @cmd1 nvarchar(1000)
    print (@cmd1)
    select @cmd1 = 'bulk insert [dbo].[SB_Monthly] from ' + @fullpath1 + ' with (FIELDTERMINATOR = ''\t'', FIRSTROW = 5, LASTROW = 675, ROWTERMINATOR=''0x0a'')'
    print(@cmd1)
    exec (@cmd1)
    I think the syntax will be somewhat similar to this:
    YEAR(date_column)=YEAR(getdate()) AND MONTH(date_column)=MONTH(getdate())
    I’m not totally sure how to incorporate that into my current syntax.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    I tried a couple versions of this.
    Declare @StartDate Date, @EndDate Date
    Select @StartDate = convert(varchar, getdate()-28, 112), @EndDate = convert(varchar, getdate()-1, 112)
    BEGIN
    declare @fullpath1 varchar(1000)
    select @fullpath1 = '''\\ms\london\FTP\' + ''' between ''' + Convert(Varchar(10), @StartDate, 101) + ''' and ''' + Convert(Varchar(10), @EndDate, 101) + '''_SP.SPC'''
    declare @cmd1 nvarchar(1000)
    print (@cmd1)
    select @cmd1 = 'bulk insert [dbo].[SPBMI_Monthly] from ' + @fullpath1 + ' with (FIELDTERMINATOR = ''\t'', FIRSTROW = 5, LASTROW = 675, ROWTERMINATOR=''0x0a'')'
    print(@cmd1)
    exec (@cmd1)
    END
    Here’s the string:
    bulk insert [dbo].[SPBMI_Monthly] from '\\ms\london\FTP\' between '02/03/2014' and '03/02/2014'_SP.SPC' with (FIELDTERMINATOR = '\t', FIRSTROW = 5, LASTROW = 675, ROWTERMINATOR='0x0a')
    The error message I keep getting is:
    Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'between'.
    Msg 319, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
    I feel like I’m already pushing this thing to the limit. 
    Maybe this last part isn’t possible.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Reading strings and integers from a text file

    I want to read the contents of a text file and print them to screen, but am having problems reading integers. The file contains employee's personal info and basically looks like this:
    Warren Laing
    32 //age, data type is int
    M //gender, data type is String
    Sharon Smith
    44
    F
    Here's what I've done so far. The method should continue reading the file until there's no lines left. When I call it from main, I get a numberFormatException error. I'm not sure why because the data types of the set and get methods are correct, the right packages have been imported, and I'm sure I've used Integer.parseInt() correctly (if not, pls let me know). Can anyone suggest why I'm getting errors, or where my code is going wrong?
    many thanks
    Chris
    public void readFile() throws IOException{
    BufferedReader read = new BufferedReader(new FileReader("personal.txt"));
    int age = 0;
    String input = "";
    input = read.readLine();
    while (input != null){
    setName(input);
    age = Integer.parseInt(input);
    setAge(age);
    input = read.readLine();
    setGender(input);
    System.out.println("Name: " + getName() + " Age: " + getAge() + " Gender: " + getGender());
    read.close();

    To answer your question - I'm teaching myself java and I haven't covered enumeration classes yet.
    With the setGender("Q") scenario, the data in the text file has already been validated by other methods before being written to the file. Anyway I worked out my problems were caused by "input = read.readLine()" being in the wrong places. The code below works fine though I've left out the set and get methods for the time being.
    Chris
    public static void readFile()throws IOException{
    String name = "";
    String gender = "";
    int age = 0;
    BufferedReader read = new BufferedReader(new FileReader("myfile.txt"));
    String input = read.readLine();
    while(input != null){
    name = input;
    input = read.readLine();
    gender = input;
    input = read.readLine();
    age = Integer.parseInt(input);
    input = read.readLine();
    System.out.println("Name: " + name + " Gender: " + gender + " Age: " + age);
    read.close();

  • [SOLVED] Can't get rid of a wine-polluted text file icon [KDE]

    Hello folks,
    For some reason, my KDE system likes to use a Wine program based icon for all text files when I'm using a Faenza theme. The problem occurs only for my user (not root) so I think this is an user-specific issue.
    I've already checked .local/share/icons folder for matching icon images. I found one which was named "text-plain.png", being equally the same "W-space" icon image as shown in the picture below. Thus I removed this png file from all necessary subfolders (22, 24, 32, 48...), so as far as I can think, there should not be any traces for the old icon image left. I've already re-checked all folders which I think are relevant to the issue. In addition, I've updated icon cache by using gtk-update-icon-cache and kbuildsycoca4 --noincremental commands. However, the system seems to disagree with me and the annoying icon appears still in text file icons.
    The problem appears practically like in the following picture:
    W-space icon image is very likely related to Adobe Photoshop which I've installed on my PlayonLinux installation (.PlayonLinux/wineprefix/photoshop). I still don't understand by which logic the system decides to use this W-space image for text files.
    I wonder if I need to take further steps to get rid of this annoying icon. Am I missing something? All I want is that KDE would use basic Faenza icon for text files. Any hints are welcome!
    Thank you!
    Last edited by Fincer (2014-09-30 11:30:43)

    Allright, this was, after all, a very simple issue. As expected.
    I simply removed file /var/tmp/kdecache-fincer/icon-cache.kcache, rebooted the system and all icons are fine now.
    Topic marked as solved.
    Last edited by Fincer (2014-09-30 11:30:58)

  • Is xml is  more Memory and CPU stealer then text files

    Is XML steal CPU and Memory usege more then reguler text files ?
    if yes then how mutch?
    Thanks itzik.

    XML is not a better way to parse data than text or fixed length. It is a STANDARD way for everyone to parse/send data.
    With a fixed length/text file, you had to know the exact position of every field. With XML, the fields describe themselves. Obviously, since the fields are no longer implied, the tags that label each element will increase the size of the file.
    The tradeoff is that DOM/SAX parsers offer an industry wide standard for parsing this type of data. With a DTD (or Schema), you can also include the required format of the doc to enforce the structure where with a text file you usually had to distribute a document with mappings.

  • HOW TO WRITE AND READ FROM A TEXT FILE???

    How can I read from a text file and then display the contents in a JTextArea??????
    Also how can I write the contents of a JTextArea to a text file.
    Extra Question::::::: Is it possible to write records to a text file. If you have not idea what I am talking about then ignore it.
    Manny thanks,
    your help is much appreciated though you don't know it!

    Do 3 things.
    -- Look through the API at the java.io package.
    -- Search previous posts for "read write from text file"
    -- Search java.sun.com for information on the java.io package.
    That should clear just about everything up. If you have more specific problems, feel free to come back and post them.

  • Reading and Writing to a Text File

    Hello all,
    I was wondering if it is possible to write from forms to a text file and if possible what is the best way to do it.
    Thanks,
    Bucky

    Use the TEXT_IO built-in functionality in forms or from the database utl_file. TEXT_IO seems to be more flexible because you can read and write to any server/directory you have access to whereas UTL_FILE is limited to the server where the database is located. Hope this helps.
    Mike

  • Adding And Removing in a text file

    Hi
    I'm trying to make a VI that generates a textfile which saves some data each second and give it some timeframe so that it can maintain only the data that has been generated last 10 seconds or so
    First I have made 2 different files, one is for saving some data each second into a text file, and the other one is for removing the data
    but when i combined those two it doesn't seem to work.
    Could anyone have a look at the file and comment on that?
    thanks
    Attachments:
    test2.vi ‏17 KB
    Time(Sub).vi ‏8 KB

    A couple comments on what you are trying to do. First, doing this with a text file is going to be inherently difficult as you are going to be doing a lot of rewriting of the file. Second, having two VIs (1 to write the data and 1 to remove the old data) is a bad approach - why not design the algorithm so the file is only written to one time for each update cycle? Stop trying to make a poor design work and spend a little time thinking outside the box.
    Hint: think about how you calculate a running average in LV, and what if the indicator out wasn't just an indicator but a file write?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • TextField ADS and not using plain text

    Hey
    Im using interactive forms and I have a problem using linebreaks. The InputField can only accept plain text. If I switch this option off, I get this error message "Node cannot be inserted where requested" when im pressing the Submit to SAP button to go back to another view.
    Someone know what im doing wrong?

    Hello Kristoffer,
    is it necessary for you to use an input field ?
    Why aren't you using a textedit field or textarea ?
    kind regards
    Fabian
    Message was edited by: Fabian Eidner

Maybe you are looking for