Q:

how to separate values in a string index that are char and int

okay basically im wanting to separate the elements in a string from int and char values while remaining in the array, but to be honest that last parts not a requirement, if i need to separate the values into two different arrays then so be it, id just like to keep them together  for neatness. this is my input:
5,4,A
6,3,A
8,7,B
7,6,B
5,2,A
9,7,B

now the code i have so far does generally what i want it to do, but not completely
here is the output i have managed to produce with my code but here is where im stuck
54A
63A
87B
76B
52A
97B

here is where the fun part is, i need to take the numbers and the character values and separate them so i can use them in a comparison/math formula.
basically i need this
int 5, 4;
char 'A';

but of course stored in the array that they are in.
Here is the code i have come up with so far.
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;

public class dataminingp1 
{

    String[] data = new String[100];
    String line;

    public void readf() throws IOException 
    {

        FileReader fr = new FileReader("C:\\input.txt");
        BufferedReader br = new BufferedReader(fr);

        int i = 0;
        while ((line = br.readLine()) != null) 
        {
            data[i] = line;
            System.out.println(data[i]);
            i++;
        }
        br.close();
        System.out.println("Data length: "+data.length);

        String[][] root;

        List<String> lines = Files.readAllLines(Paths.get("input.txt"), StandardCharsets.UTF_8);

        root = new String[lines.size()][];

        lines.removeAll(Arrays.asList("", null)); // <- remove empty lines

        for(int a =0; a<lines.size(); a++)
        {
            root[a] = lines.get(a).split(" ");
        }

        String changedlines;
        for(int c = 0; c < lines.size(); c++)
        {
            changedlines = lines.get(c).replace(',', ' '); // remove all commas
            lines.set(c, changedlines);// Set the 0th index in the lines with the changedLine
            changedlines = lines.get(c).replaceAll(" ", ""); // remove all white/null spaces
            lines.set(c, changedlines);
            changedlines = lines.get(c).trim(); // remove all null spaces before and after the strings
            lines.set(c, changedlines);
            System.out.println(lines.get(c));

        }
    }

    public static void main(String[] args) throws IOException 
    {
        dataminingp1 sarray = new dataminingp1();
        sarray.readf();
    }   
}

i would like to do this as easily as possible because im not to incredibly far along with java but i am learning so if need be i can manage with a difficult process. Thank you in advance for any at all help you may give. Really starting to love java as a language thanks to its simplicity.
This is an addition to my question to clear up any confusion.
what i want to do is take the values stored in the string array that i have in the code/ input.txt and parse those into different data types, like char for character and int for integer. but im not sure how to do that currently so what im asking is, is there a way to parse these values all at the same time with out having to split them into different arrays cause im not sure how id do that since it would be crazy to go through the input file and find exactly where every char starts and every int starts, i hope this cleared things up a bit.

A:

Here is something you could do:
    int i = 0;
    for (i=0; i<list.get(0).size(); i++) {
        try {
            Integer.parseInt(list.get(0).substring(i, i+1));
            // This is a number
            numbers.add(list.get(0).substring(i, i+1));
        } catch (NumberFormatException e) {
            // This is not a number
            letters.add(list.get(0).substring(i, i+1));
        }
    }

When the character is not a number, it will throw a NumberFormatException, so, you know it is a letter.

