Username:
Password:
Cradle can import from CSV files into a subset of the item types in a Cradle database:
Once you have some data in CSV format, to import it into Cradle you open the Import Information dialog by selecting File → Import:
Set the File Type to CSV:
You can control who will own the information that is imported from the CSV file. The default is that you (your current Cradle username) will own the information. If you have the appropriate privileges, then you can specify another user, or the ownership of the items created in the database by the import can be owned by owners specified in the CSV data.
Cradle provides an Overwrite option with three values:
that controls whether and how data from the CSV file is loaded into the database.
If your CSV file has a first record containing the names of the fields in the file (all CSV files produced by Cradle have this form), then the Assign recognised fields checkbox is useful because it will examine the field names in the first record of the file and automatically match them against the attributes of the type of information that you want to import.
The Append missing fields checkbox is provided to overcome faults in some applications where empty fields were not output into the CSV file. For example, some versions of Excel had this bug, Excel 2003 and Excel 2007 do not.
To import the first example data file containing:
R1,,A,”This is an example requirement” R2,,A,”This is another example requirement” R3,,A,”This is a third example requirement”
into the pre-defined Requirements item type, you set the Info Type to be Requirements (which it is by default), locate the file in the From file: field and click Import and the CSV Fields dialog will appear:
The first record in this CSV file does not list field names, so set the Import first record checkbox to ensure that we capture data from this record.
The left hand side of the dialog shows the contents of the fields in the first record in the CSV file and the Requirements attribute currently mapped to them. Initially, there are no mappings. On the right of the dialog is a list of all of the attributes in Requirement items that can be imported from CSV files (so this list excludes binary frames).
To specify a mapping, select a field in the CSV file in the list on the left hand side (you do not have to define mappings for all fields in the CSV file) and double click the attribute from the right hand list. For Requirement items, we must have mappings defined for the Number, Version and Draft ID attributes. These are the first three fields in each record in our example CSV file. So, with field 1 selected, we double click on Number in the right hand list and Number will disappear from the list because we have now assigned a CSV field to it:
We use the same process to define mappings for fields 2 and 3 in the CSV file:
If you make a mistake, double-click the incorrect mapping in the list on the left hand side of the dialog and the mapping will be removed and the attribute will re-appear in the list on the right hand side of the dialog.
You complete the mapping by assigning the fourth CSV file field to the TEXT frame:
When your mapping is complete, select OK and the import will occur and its progress is shown in the Import Status dialog:
You can produce a log of the import by selecting Log… to display a report listing which items were imported, and any items that were not imported and the reason why they were not imported:
The mappings for importing the example system note data:
SBS,1.2.3,,A,”This is part of the SBS” SBS,1.2.3.1,,A,”This is a child of the previous item in the SBS” SBS,1.2.3.2,,A,”This is another child of the item in the SBS”
are similar, except that we set the Info Type to be System Notes and we must define mappings for the Type, Number, Version and Draft ID attributes:
Finally, to import the example cross references:
,NOTE_NOTE,MH_IGNOREMODEL,SBS,1.2.3,,MH_IGNOREMODEL,SBS,1.2.3.1 ,NOTE_NOTE,MH_IGNOREMODEL,SBS,1.2.3,,MH_IGNOREMODEL,SBS,1.2.3.2
we set the Info Type to be Cross References and we define mappings for the Baseline, Xref Type, From Model Namespace, From Type, From Number, Link Type, To Model Namespace, To Type and To Number attributes:
Back to the newsletter archive.