Formats for data import in CDMS
Table of Contents
In Castor it is possible to import data captured with other tools. The article Import study data provide an extensive explanation of the preparation of the datasheet and the forms to import it in Castor.
This article outlines some specific data formats that you need to be aware of when preparing your data for import.
Importing option group data: radio buttons, dropdowns, checkboxes
Below you will find the requirements to prepare the option groups for import.
Importing radio buttons / dropdowns
Enter a value that corresponds to the option value that should be selected. The option values have to match the option values specified in Castor.
Importing checkboxes
Since checkboxes allow for multiple answers to be selected, each answer option needs to be in a separate column indicating, in the first row, the variable name of the checkbox field and the option label as follows: variablename#option_label. If a particular option of a checkbox field should be selected, it has to have a value '1'. If it is not selected, then the value should be '0'.
Tip: You can best approach this by first exporting the data from a test participant, so you have the columns ready. Please do note, however, that long label names can be cut off in the export. Simply adding back the label should resolve the issue. Another issue can be the use of special characters in the label: some characters should be skipped upon creating the variable name with the option label, while others should be replaced with an underscore. See the list below:
Variable name used for import | Original option label from export | Special character | Replaced by |
check#testa | test,a | , | skipped |
check#testb | test.b | . | skipped |
check#testc | test/c | / | skipped |
check#test_d | test_d | _ | _ |
check#teste | test-e | - | skipped |
check#testf | test'f | ‘ | skipped |
check#testg | test"g | “ | skipped |
check#testh | test;h | ; | skipped |
check#testi | test:i | : | skipped |
check#testj | test`j | ` | skipped |
check#testk | test(k | ( | skipped |
check#testl | test)l | ) | skipped |
check#testm | test+m | + | skipped |
check#testn | test?n | ? | skipped |
check#testo | test[o | [ | skipped |
check#testp | test]p | ] | skipped |
check#testq | test&q | & | skipped |
check#testr | test!r | ! | skipped |
check#test@s | test@s | @ | @ |
check#test#t | test#t | # | # |
check#test$u | test$u | $ | $ |
check#testv | test%v | % | skipped |
check#testw | test^w | ^ | skipped |
check#testx | test*x | * | skipped |
check#testy | test"y | “ | skipped |
check#testz | test{z | { | skipped |
check#testa1 | test}a1 | } | skipped |
check#testb1 | test|b1 | | | skipped |
check#testc1 | test\c1 | \ | skipped |
check#test_d1 | test d1 | space | _ |
Importing grid field data
When a grid field is exported, each grid cell is exported as its own column, which is labeled as Variablename_rowname_columnname. The grid data should be prepared for import in the same way.
An example of this can be seen here. We have a grid field with the variable name 'grid_test' containing 3 columns, 'Hip', 'Knee' and 'Ankle' and 3 rows: 'Date', 'Score' and 'Range of Movement'. The configuration shows that each cell contains a 'number' field.
Our spreadsheet, prepared for import, contains a column for each grid column and row:
Please note: Row and column names cannot have special characters in Castor for the import to work. That includes parentheses.
Importing user missing data
To assign data as user missing before importing, you should use the value ##USER_MISSING_99## in the appropriate cell. (This will import the value -99, you can replace 99 with any of the other values that are used for user missing, from -95 to -99).
Importing ##USER_MISSING_xx## is possible to all fields with the exception of Grid & Checkbox fields.
As a complement, here is a summary of the notable data formats required in the different kinds of fields where data import is possible:
Field_labels | - Max. 1048 characters |
Variable names | - Max. 64 characters |
Radiobutton / dropdown | - One column with the variable name as header - Option value matches options in Castor |
Checkbox field | - One column per option - No special characters in the option labels (such as > / $ # _ @) - Input column name: variablename#optionname (spaces in the option labels are replaced by _) - Values 0 or 1 |
Date field (Full dates or Partial dates) | - DD-MM-YYYY or UK-MM-YYYY; UK-UK-YYYY; 00-MM-YYYY; 00-00-YYYY |
Date & time field | - DD-MM-YYYY HH:MM |
Number field | - Decimal position: . (point) - Maximum upper limit: 100 000 000 |
Number & date field | - Separate number and date columns - Column headers: variablename_number;variablename_date - The number and date field should be separated by a semicolon, for example 15;15-04-2021 - Additionally, make sure that the separator in the CSV file is commas, not semicolons |
Text / Multiline text field | - Max. length = 4196 characters |
Time field | - HH:MM |
Year field | - YYYY - Range: 1891 - 2099 |
Grid field | - No special characters in the row and column names (such as > / $ # _ @) - One column per cell - Column headers: variablename_row_name_column_name (spaces are replaced by _) - The values should be formatted as text, radiobutton value, number, or date |
Slider field | - One column with the variable name as header - Value must be numerical and must be within specified slider limits and increments |
Calculation | - Calculation values can be imported - If the value is incorrect as per the calculation specifications, this will be updated when the calculation is run in Castor |
Repeated measure | See import repeating data. |
Other field types | Cannot be imported |