I have a data file named “data.txt” that contains the following lines:
HDR;Albert;Aal;Ammengasse 1;11111;Amelinghausen;1
POS;Product 1;11,11
POS;Product 2;22,22
POS;Product 3;33,33
HDR;Bernd;Brecher;Brunnentalweg 2;22222;Berneburg;2
POS;Product 4;44,44
POS;Product 5;55,55
There are records of type HDR that carry some header information for each document and that are followed by records of type POS containing information about products and their prices.
I created a new DataMapper configuration and selected the fuile “data.txt” (after switching the filter in the file open dialog to “Text file (*.txt, *.dat, *.prn)”.
The field separator is set to “;”.
When I switch to the “Steps”-panel no data is shown; the messages panel contains a long list of entries (saved as a text file it is about 42 KB).
Q1: what is wrong with the file?
Q2: shall I insert the messages as text here or is there a way to upload such files?
Edit 1: after renaming the file to “data.csv” I got a message:
ERROR [12 Feb 2015 12:51:13,916][main] com.objectiflune.datamining.ui.model.RefreshBoundariesJob$2.run(?:?) Error while refreshing document boundaries: Line contains wrong number of columns: 2 1 (DME000048)
com.objectiflune.datamining.DocumentManager$DocumentInputException: java.sql.SQLException: Line contains wrong number of columns: 2 1
at com.objectiflune.datamining.tabular.internal.handlers.TabularDocumentManager.nextBoundaries(Unknown Source)
at com.objectiflune.datamining.DocumentManager.refresh(Unknown Source)
at com.objectiflune.datamining.PluginInput.refresh(Unknown Source)
at com.objectiflune.datamining.ui.model.RefreshBoundariesJob.run(Unknown Source)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.sql.SQLException: Line contains wrong number of columns: 2 1
at org.relique.jdbc.csv.CsvReader.getEnvironment(Unknown Source)
at org.relique.jdbc.csv.CsvResultSet.next(Unknown Source)
at com.objectiflune.datamining.tabular.internal.documentdata.DocumentHandler.nextRecord(Unknown Source)
… 5 more
That sounds as if it is required to have the same number of fields in every record.
If so: what is the “correct” way to read a file such like the onw described above?