Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Is this possible ?

Options
  • 09-05-2003 7:03pm
    #1
    Registered Users Posts: 8,070 ✭✭✭


    Is it possible to make a program that takes in a text file or probably just even text and gives the output of a certain word in the text coloured.

    Eg: you enter a few lines of text and you tell it to colour the word 'hello' to blue, so hello anywhere in the text will be turned to blue .

    Its probably not posibble to do in java ? is it ! i havent started doing C, C++ yet so erm ? C++ ?


    Thanks .


Comments

  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    Output to what?


  • Registered Users Posts: 8,070 ✭✭✭Placebo


    or how about it adds <b> </b> before and after the word .


  • Registered Users Posts: 16,413 ✭✭✭✭Trojan


    Of course it's possible. What you're really asking, is "show me how to".

    You need to look at string manipulation functions.

    Check out string.h and functions, such as strcmp() and strncmp() for more info on how to do it in C.

    If you don't understand those pages, look up strcmp etc in google, and your nearest C book.

    Why is tuxedo.org/~esr still down?! I wanted to link to the howto ask a question page... grrr.

    Al.


  • Registered Users Posts: 1,186 ✭✭✭davej


    Originally posted by Placebo
    or how about it adds <b> </b> before and after the word .

    As Talliesin said, what do want to output to, STDOUT?

    Or are you talking about outputting html to client from a webserver? If so look at jsp / asp /php / perl - cgi

    For example try doing a keyword search for a word on boards.ie.
    EG: Javascript. When you click on any of the results you will see that any occurence of the word Javascript will be highlighted in red. This was done with php.

    Its probably not posibble to do in java ?

    What? Of course it is. If you are interested in formatting text in a specific way based on patterns in an input file, see "Regular Expressions" on google.

    davej


  • Registered Users Posts: 491 ✭✭Silent Bob


    Originally posted by Trojan
    Why is tuxedo.org/~esr still down?! I wanted to link to the howto ask a question page... grrr.

    It's because ESR isn't there anymore, try www.catb.org/esr


  • Advertisement
Advertisement