Reputation: 2906
I try to get data from several csv files. I use ConcatenateFilesDatabaseConnection for db
Database getDbFromFiles(List<File> files) {
ListParameterization params = new ListParameterization();
params.addParameter(ConcatenateFilesDatabaseConnection.Parameterizer.PARSER_ID, files);
Database db = ClassGenericsUtil.parameterizeOrAbort(StaticArrayDatabase.class, params);
return db;
}
like for FileBasedDatabaseConnection
ListParameterization params = new ListParameterization();
params.addParameter(FileBasedDatabaseConnection.Parameterizer.INPUT_ID, filename);
Database db = ClassGenericsUtil.parameterizeOrAbort(StaticArrayDatabase.class, params);
but when i run i get error
de.lmu.ifi.dbs.elki.utilities.optionhandling.UnspecifiedParameterException: No value given for parameter "dbc.in": Expected: The name of the input file to be parsed. de.lmu.ifi.dbs.elki.utilities.optionhandling.WrongParameterValueException: Wrong value of parameter dbc.parser. Read: [src\main\resources\data1.csv, src\main\resources\data2.csv, src\main\resources\data3.csv]. Expected: Parser to provide the database. Implementing de.lmu.ifi.dbs.elki.datasource.parser.Parser
Maybe someone worked with several files on ELKI and knew how to do it right. I did not find the code to handle multiple files in ELKI
Upvotes: 0
Views: 146
Reputation: 8715
You set the parser to a List<File>
. That cannot work.
A parser is a program routine that interprets the input of some (text) data stream.
You need to set the right parameter (the input file name, not the parser).
Upvotes: 1