code: public static double[] readFileColumn(String filename, int columnIdx, int sizeLimit)
        throws IOException, SAXException {
  
      // make sure the path exists
      Path path = Paths.get(filename);
      if (!(Files.exists(path))) {
        throw new SAXException("unable to load data - data source not found.");
      }
  
      BufferedReader br = new BufferedReader(
          new InputStreamReader(new FileInputStream(filename), "UTF-8"));
  
      return readTS(br, columnIdx, sizeLimit);
    }
docs: Reads timeseries from a file. Assumes that file has a single double value on every line.
  Assigned timestamps are the line numbers.
  
  @param filename The file to read from.
  @param columnIdx The column index.
  @param sizeLimit The number of lines to read, 0 == all.
  @return data.
  @throws IOException if error occurs.
  @throws SAXException if error occurs.