Q:

About sorting elements of a line in a csv file and storing it into different Arraylists

So  I have a CSV file that kinda looks like this :
LS1312, AWFXQA, -12107909  
LS1313, VEDSBJV, -55003726  
LS1314, UCRQSE, -1711111

....
Therefore,  I'm wondering how I can store the first element of the line (for example LS1312, 
 LS1313) into my first ArrayList and the second element(AWFXQA, VEDSBJV) into the second ArrayList and the last element (-12107909, -55003726) into the third ArrayList?
This is what I have right now: I managed to read the file but am not sure how to store elements in its respective Arraylist.
public static void main(String[] args) throws FileNotFoundException {

    Scanner scanner = new Scanner(new File(args[0]));

    scanner.useDelimiter(",");

    ArrayList < String > arrlist1 = new ArrayList < >();
    ArrayList < String > arrlist2 = new ArrayList < >();
    ArrayList < String > arrlist3 = new ArrayList < >();

    while (scanner.hasNext()) {
        arrlist1.add(scanner.next());
    }
    scanner.close();
}

A:

You should use split() method to split the line and assign to the equivalent array
public static void main(String[] args) throws FileNotFoundException {
    Scanner scanner = new Scanner(new File(args[0]));
    ArrayList<String> arrlist1 = new ArrayList<>();
    ArrayList<String> arrlist2 = new ArrayList<>();
    ArrayList<String> arrlist3 = new ArrayList<>();

    String[] split;
    while (scanner.hasNextLine())  {
        split= scanner.nextLine().split(",");
        arrlist1.add(split[0]);
        arrlist2.add(split[1]);
        arrlist3.add(split[2]);
    }
    scanner.close();
}

