Results 1 to 3 of 3
  1. #1
    mattgavin is offline Member
    Join Date
    Nov 2010
    Rep Power

    Default Reading part of file with BufferedReader


    I'm trying to write a function that grabs a certain part of a file, sends that to another function, then continue to do the same thing from where the BufferedReader left off until the end of the file but can't seem to figure out how to make it work.

    Here is what I have:

    Java Code:
    String str = "";
    int count = 0; 
    	try {
    		while(read through the entire file...){
    			while ((count <  4)){	
    				str +=;
    			DoSomething(str) // send str to another function and do something with it;
    		} catch (IOException e) {
    			// TODO Auto-generated catch block
    Can someone help me with this and explain what I'm doing wrong? Much would be appreciated
    Last edited by mattgavin; 11-12-2010 at 07:35 PM.

  2. #2
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Waterford, Ireland
    Rep Power


    1st. atleast try to solve your problem (you know exactly what I mean)

    2nd. maybe this Random Access Files (The Java™ Tutorials > Essential Classes > Basic I/O)

  3. #3
    curmudgeon is offline Senior Member
    Join Date
    May 2010
    Rep Power


    Quote Originally Posted by al_Marshy_1981 View Post
    Huh? How does this relate to anything the OP was asking?

Similar Threads

  1. Reading part of a line in a text file
    By aaronfsimons in forum New To Java
    Replies: 3
    Last Post: 05-04-2009, 07:57 AM
  2. Reading a file from Applet (BufferedReader)
    By Java Tip in forum Java Tip
    Replies: 1
    Last Post: 06-22-2008, 10:51 PM
  3. Reading file contents (BufferedReader)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-07-2008, 09:00 AM
  4. Reading text from a URL using BufferedReader
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-26-2007, 10:17 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