您当然可以使用 Java 来总结这些信息。例如,如果您的目标是计算每列的最小值、最大值和平均值,您可以编写如下内容:
final BufferedReader br =
new BufferedReader(new FileReader("/this/is/the/path/to/the/file.txt"));
final int[] mins = { Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE,
Integer.MAX_VALUE, Integer.MAX_VALUE };
final int[] maxes = { Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE,
Integer.MIN_VALUE, Integer.MIN_VALUE };
final double[] sums = { 0.0, 0.0, 0.0, 0.0, 0.0 };
int count = 0;
try {
String line;
while((line = br.readLine()) != null) {
++count;
final String[] values = line.split("\\s+");
for(int i = 0; i < 5; ++i) {
final int value = Integer.parseInt(values);
if(value < mins[i]) {
mins[i] = value;
}
if(value > maxes[i]) {
maxes[i] = value;
}
sums[i] += value;
}
}
} finally {
br.close();
}
final double[] averages = new double[sums.length];
for(int i = 0; i < sums.length; ++i) {
averages = sums[i] / count;
}
System.out.println(Arrays.toString(mins));
System.out.println(Arrays.toString(maxes));
System.out.println(Arrays.toString(averages));