Converting a text file to a CSV file
If your input is already separated correctly by spaces, it seems all you need to do is to convert those into commas and you're good. I'm not sure you need to go to/from arrays.

I would replace the code inside the loop:

{
    String line = subFile.nextLine();            
    String[] split = line.split("\\s+");            
    StringJoiner joiner = new StringJoiner(",");

    for (String strVal: split)
        joiner.add(strVal);

    line = joiner.toString();
    line = line.startsWith(",") ? line.substring(1) : line;
    fileArray[i++] = line;            
}


with this:

{
    String line = subFile.nextLine();            
    line.trim().replaceAll(" +", " "); //check for double spaces
    line.replace(' ', ',');   //replace space with comma
    fileArray[i++] = line; 
}


Oh, and check for the array size like someone else mentioned.