Results 1 to 9 of 9
  1. #1
    RafalD is offline Member
    Join Date
    Dec 2012
    Posts
    16
    Rep Power
    0

    Default Searching text in file

    Hi!

    I have another problem.
    I must search text(example: "color" and "border-color") and import and edit text after this.
    Example:
    this:
    XML Code:
    font: Ariel;
    color: #ffff00;
    border: 1px;
    border-color: #ffff00;
    to this:
    XML Code:
    font: Ariel;
    color: #00ffff;
    border: 1px;
    border-color: #00ffff;
    Greetings,
    Rafał

    PS: Sorry for my bad english.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,839
    Rep Power
    8

    Default Re: Searching text in file

    Your English is fine, but you didn't actually ask a question.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Searching text in file

    Moved from Advanced Java.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    RafalD is offline Member
    Join Date
    Dec 2012
    Posts
    16
    Rep Power
    0

    Default Re: Searching text in file

    @KevinWorkman, my question:
    Could you tell me, how can i make it what is in my example?

  5. #5
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,839
    Rep Power
    8

    Default Re: Searching text in file

    Which part is giving you trouble? Reading in a file? Searching a String? Replacing a String? Something else? What have you tried? What do you have so far? Where exactly are you stuck?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #6
    RafalD is offline Member
    Join Date
    Dec 2012
    Posts
    16
    Rep Power
    0

    Default Re: Searching text in file

    I'm not started yet.
    My question is: What java library offers methods that will I need.

    I will view the documentation and should I make this.

  7. #7
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,839
    Rep Power
    8

    Default Re: Searching text in file

    It really depends on what you're asking about, specifically. You might want to look at the String API, or the Java IO tutorials, or a Scanner, or even Swing tutorials if you require a gui. But I'm just guessing since I don't know what your actual issue is.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  8. #8
    RafalD is offline Member
    Join Date
    Dec 2012
    Posts
    16
    Rep Power
    0

    Default Re: Searching text in file

    May unnecessarily I started this topic so early. I will search through the library and see what I want to ask :P

  9. #9
    RafalD is offline Member
    Join Date
    Dec 2012
    Posts
    16
    Rep Power
    0

    Default Re: Searching text in file

    I use code:
    Java Code:
    File css = new File(cssdirectory+incss);
    Scanner skaner = new Scanner(css).useDelimiter(".*:\\s*#w*");
    System.out.println(skaner.next());
    And program return in console:
    /*!
    * Copyright(c) etc...
    */
    mask {
    instead
    cdf;
    I wrong understand this commands?

Similar Threads

  1. Searching Text Files Then Removing (My First Post!)
    By technoreject in forum New To Java
    Replies: 12
    Last Post: 06-29-2011, 06:51 AM
  2. Replies: 0
    Last Post: 02-25-2011, 08:13 AM
  3. searching a row using text fields
    By bigj in forum New To Java
    Replies: 1
    Last Post: 02-03-2010, 11:28 AM
  4. Searching a string from a text file using Swing Buttons
    By pradeep1_mca@yahoo.com in forum AWT / Swing
    Replies: 2
    Last Post: 09-15-2008, 09:50 AM
  5. Searching a String from Text file using Swings .
    By pradeep1_mca@yahoo.com in forum AWT / Swing
    Replies: 4
    Last Post: 09-09-2008, 05:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •