Reading multiple data values per line using BufferedReader
<p>I am making a program that reads data from a file called playoffs.txt. Each line has a team name, score, and division, each separated by colons, like so:</p>

<pre><code>Panthers:0:Atlantic
Lightning:0:Atlantic
Red Wings:0:Atlantic
</code></pre>

<p>I want to run a for loop that prints out this for each team:</p>

<pre><code>Team: Panthers
Series Score: 0
Division: Atlantic
</code></pre>

<p>However, I'm having trouble figuring out how to separate the values on each line, since readLine seems to print out the entire line. Here's my method:</p>

<pre><code>private static void series(String team1) throws FileNotFoundException, IOException{
    BufferedReader in = new BufferedReader(new FileReader("playoffs.txt"));

    String[] team = new String[0];
    int[] score = new int[0];
    String[] division = new String[0];
    String s;
    int j = 0; 
    while((s = in.readLine()) != null){
        String[] var = s.split(":");
        team[j] = in.readLine(var[0]);
        score[j] = in.read();
        division[j] = in.read();
        cout.println(team[j]);
        cout.println(score[j]);
        cout.println(division[j]);
        j++;
    }
}
</code></pre>

<p>I'm new to Java and the s.split line I found on another StackOverflow question that was similar to my question, and it runs an error saying "String cannot be converted to boolean." I'm also confused about the difference between readLine() and read(). Any help to point me in the right direction to read each value separately would be appreciated.</p>