-
Notifications
You must be signed in to change notification settings - Fork 97
Description
Describe the bug
I created a custom model in Excel (XLSX) and exported to CSV. This file failed to load and resulted in this error
java.lang.IllegalArgumentException: Mapping for table not found, expected one of [table, field, required, type, schema, description] at org.apache.commons.csv.CSVRecord.get(CSVRecord.java:121) at org.ohdsi.rabbitInAHat.dataModel.Database.generateModelFromCSV(Database.java:117) at org.ohdsi.rabbitInAHat.RabbitInAHatMain.doSetTargetCustom(RabbitInAHatMain.java:465) at org.ohdsi.rabbitInAHat.RabbitInAHatMain.lambda$createMenuBar$9(RabbitInAHatMain.java:268)
The problem is that CSV parsing does not account for the Byte Order Mark (BOM).
To Reproduce
Steps to reproduce the behavior:
- Create a custom model in Excel (XLSX)
- Export the model to CSV
- Use Edit -> Set Target Database -> Load Custom
- Select the exported CSV, receive a popup error that the column headers were not found.
Expected behavior
CSV opens correctly.
Workaround
Open the exported CSV in a text editor and change the encoding from "UTF-8 with BOM" to "UTF-8"
Desktop (please complete the following information):
- OS: OSX 14.4.1
- Java: 11.0.21
- Rabbit Version : 10.8a
Additional context
The issue