Results 1 to 3 of 3

Thread: File handling.

  1. #1
    zarak is offline Member
    Join Date
    Oct 2011
    Posts
    3
    Rep Power
    0

    Default File handling.

    Hello everyone.

    There's this assignment that I have to work on and for that, I have to open an HTML file in JCreator and save it in a string. Then I have to search the string with the HTML file in it for some tags. If you guys could help me out with opening the file and saving it to a string , that'd be great. :)

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    6

    Default Re: File handling.

    With the openStream() method of the URL class object you will get a InputStream which you can read from with the BufferedRader/Scanner class ( in use of a StringBuilde rmaybe)

  3. #3
    dheaven is offline Member
    Join Date
    Oct 2011
    Posts
    15
    Rep Power
    0

    Default Re: File handling.

    You could could open it as a text file and read line by line until you meet the tag you want. Separating the other stuff can be done by using the StringTokenizer class. You can read about it here:
    Foobar: Text File I/O in Java

Similar Threads

  1. File handling
    By Dayanand in forum New To Java
    Replies: 3
    Last Post: 03-23-2011, 09:28 AM
  2. File handling
    By Dayanand in forum New To Java
    Replies: 7
    Last Post: 03-23-2011, 07:31 AM
  3. File handling
    By Dayanand in forum New To Java
    Replies: 1
    Last Post: 03-22-2011, 07:07 PM
  4. Regarding File Handling
    By ravjot28 in forum New To Java
    Replies: 1
    Last Post: 01-20-2010, 09:15 PM
  5. handling WAV file
    By zellazode in forum New To Java
    Replies: 1
    Last Post: 09-08-2009, 03:46 PM

Posting Permissions

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