I've found a lot of similar questions on Stack Overflow so far, but none of them have actually answered my question. How do I read the data from different columns in a text file into three separate arrays?

Currently my BufferedReader is going through the entire text file and reading it line by line. The problem is, each line is stored as a singular array element.

As you can see, I tried to access the array elements by calling certain data from the "lines[]" array, which contains all of the lines in the file as separate elements. I just have no idea how to access those elements individually and then store them all in separate arrays. Below are the contents of the text file I'm reading from, and then the Java code itself.

```
(Name,Team,Score)
John,Blue,20
Jamie,White,28
Jonathan,Blue,19
Ron,White,39
Ron,Blue,29

```

--

```
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class Bowling7 {

    public static void main(String[] args) {
        try {
            BufferedReader fin = new BufferedReader(new FileReader(new File("bowling.txt")));
            System.out.println("File open successful!");

            int line = 0;
            String[] lines;
            String[] names;
            String[] teams;
            int[] scores;

            for (String x = fin.readLine(); x != null; x = fin.readLine()) {
                lines = x.split(",");
                teams[line] = lines[line];
                scores[line] = lines[line];
                line++;
            }

            System.out.println(lines[0]);
            System.out.println(lines[1]);

        catch (IOException e) {
            System.out.println("File I/O error!");
        }
    }
}

```