file Handling

Discussion in 'Java' started by HESH, Sep 27, 2007.

  1. HESH

    HESH Guest

    hi everyone,

    I need a Java Code to extract a string from a file.File contains txt
    but i only want to extract the txt after string Object Class. Actually
    this file is the file containing classes and attributesbut i only want
    to extract class name.
    example file text:
    object class "class1"mmmmmmmmmmm
    mmmmmmmmmmmmmm
    mmmmmm
    object class "class2"
    ghj

    I want a string array containing class1,class2.

    thnks & regards
    maHESH
    HESH, Sep 27, 2007
    #1
    1. Advertising

  2. HESH wrote:
    > hi everyone,
    >
    > I need a Java Code to extract a string from a file.File contains txt
    > but i only want to extract the txt after string Object Class. Actually
    > this file is the file containing classes and attributesbut i only want
    > to extract class name.
    > example file text:
    > object class "class1"mmmmmmmmmmm
    > mmmmmmmmmmmmmm
    > mmmmmm
    > object class "class2"
    > ghj
    >
    > I want a string array containing class1,class2.
    >
    > thnks & regards
    > maHESH
    >


    Look at Pattern and Matcher.

    --

    Knute Johnson
    email s/nospam/knute/
    Knute Johnson, Sep 27, 2007
    #2
    1. Advertising

  3. HESH

    Roedy Green Guest

    Roedy Green, Sep 27, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas Due

    Handling large file upload

    Thomas Due, Aug 11, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    3,946
    Jos Vernon
    Aug 20, 2003
  2. uwb
    Replies:
    4
    Views:
    364
  3. Mark Tarver
    Replies:
    22
    Views:
    1,302
    J Kenneth King
    Apr 26, 2009
  4. Peter
    Replies:
    34
    Views:
    1,936
    James Kanze
    Oct 17, 2009
  5. Iñaki Baz Castillo
    Replies:
    1
    Views:
    187
    Iñaki Baz Castillo
    Apr 15, 2008
Loading...

Share This Page