Taking student scores from a file, calculating averages, and printing
Declaring that main() throws IOException is probably the right thing to do for a simple program like this.  A lot of beginners try to catch an exception that they don't have any idea how to handle properly.

That's a lot of code to be stuffed into a single main() function.  Ideally, you should develop classes such that main() contains just a minimal amount of code, like this:

public static void main(String[] args) throws IOException {
    try (Scanner input = args.length &gt; 0 ? new Scanner(new File(args[0])) :
                                           new Scanner(System.in)) {
        GradeBook book = new GradeBook(input);
        System.out.println(book);
        System.out.printf("Overall Average: %s\n", 
                          FMT.format(book.average()));
    }
}


Hard-coding an input filename makes it hard to reuse your code.  I've modified it to read from either a filename specified on the command line or from System.in.

You should be able to avoid having to explicitly specify the dimensions of the data in the file.

Using Java 8 streams removes a lot of tedious looping from the implementation.  Here is the rest of my suggested implementation:

import java.io.File;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.IntStream;

public class GradeBook {
    private List&lt;double[]&gt; students;
    private static final DecimalFormat FMT = new DecimalFormat("#.#");

    public GradeBook(Scanner input) {
        this.students = new ArrayList&lt;double[]&gt;();
        while (input.hasNextLine()) {
            double[] student = Arrays.stream(input.nextLine().trim().split("\\s+"))
                  .mapToDouble(Double::parseDouble)
                  .toArray();
            students.add(student);
        }
    }

    public double getScore(int student, int assignment) {
        return this.students.get(student)[assignment];
    }

    public double averageForStudent(int student) {
        return Arrays.stream(this.students.get(student))
                     .average()
                     .getAsDouble();
    }

    public double averageForAssignment(int assignment) {
        return this.students.stream()
                   .mapToDouble((assignments) -&gt; assignments[assignment])
                   .average()
                   .getAsDouble();
    }

    public double average() {
        return IntStream.range(0, this.students.size())
                        .mapToDouble((s) -&gt; this.averageForStudent(s))
                        .average()
                        .getAsDouble();
    }

    public String toString() {
        StringBuilder out = new StringBuilder();
        int numAssignments = this.students.stream()
                                 .mapToInt((assignments) -&gt; assignments.length)
                                 .max()
                                 .getAsInt();

        // Header
        out.append("\t\t\t\tAssignment #:\n\t\t");
        for (int a = 0; a &lt; numAssignments; a++) {
           out.append(a + 1).append('\t'); 
        }
        out.append("Avg\n");

        // Body
        for (int s = 0; s &lt; this.students.size(); s++) {
            out.append("Student #").append(s + 1).append(":\t");
            for (int a = 0; a &lt; numAssignments; a++) {
                out.append(FMT.format(this.getScore(s, a))).append('\t');
            }
            out.append(FMT.format(this.averageForStudent(s))).append('\n');
        }

        // Footer
        out.append("Average\t\t");
        for (int a = 0; a &lt; numAssignments; a++) {
            out.append(FMT.format(this.averageForAssignment(a))).append('\t');
        }
        out.append('\n');

        return out.toString();
    }

    public static void main(String[] args) throws IOException {
        try (Scanner input = args.length &gt; 0 ? new Scanner(new File(args[0])) :
                                               new Scanner(System.in)) {
            GradeBook book = new GradeBook(input);
            System.out.println(book);
            System.out.printf("Overall Average: %s\n",
                              FMT.format(book.average()));
        }
    }
}