#!/usr/bin/octave -q
## -*-octave-*-

datafiles = argv();
quantiles = [0 0.5 0.90 0.99];

mat = zeros(0, length(quantiles));
names = {};

for i=1:length(argv),
  x = load(datafiles{i})*1e6;
  q = quantile (x, quantiles);
  mat = [ mat; q' ];
  [d, n, e, v] = fileparts(datafiles{i});
  names{i} = n;
end

[mat, ind] = sortrows(mat, 2);
result = [names(ind)', num2cell(mat)];
cell2csv("result", result, ' ', '"');
