Import Requirements from Microsoft Office Documents
You can author requirements in Microsoft® Word and Microsoft Excel® and import them into Requirements Toolbox™. When you import the requirements, you can allow updates from the Microsoft Office documents, or you can import them without allowing updates. To read more about these import modes, see Select an Import Mode.
To import requirements from a Microsoft Office document:
Open the Requirements Editor. At the MATLAB® command line, enter:
Set the Document type to
Microsoft Word Documentor
Microsoft Excel Spreadsheet.
Next to the Document Location field, click Browse and select the desired file.
Set the import options. To read more about import options for Microsoft Office documents, see Import Options for Microsoft Word Documents and Import Options for Microsoft Excel Spreadsheets. To read more about importing requirement sets or referenced requirements, see Select an Import Mode.
Click Import to import the requirements.
Import Options for Microsoft Word Documents
You can import requirements in plain and rich text formats from Microsoft Word documents. Use the rich text format to import requirements that contain content such as graphics and tables.
When you import requirements from Microsoft Word documents, the section headers and numbers populate the ID and Summary fields and the section body populates the Description field. To ignore section numbers in the imported requirements, select Ignore outline numbers in section headers. If you select Allow updates from external source, it is recommended to ignore outline numbers to prevent unexpected behavior that can occur if the section numbers change when you make changes to your Microsoft Word document and then update the imported requirements. For example, when you insert a new section in the middle of your document, some of the outline numbers in the section headers change to reflect the new section numbering. When you update the requirement set, Requirements Toolbox deletes the referenced requirements that correspond to sections whose outline numbers changed and re-inserts them with the updated numbering. This can create some unexpected and unnecessary change issues.
The imported requirements hierarchy matches the Microsoft Word document headings hierarchy.
When you import requirements, it is recommended to select Use bookmarks to identify items and serve as custom IDs because the bookmarks are persistently stored in the document and cannot be duplicated.
You can import requirements selectively when you select Identify items by occurrences of search pattern (REGEXP) and enter a regular expression search pattern. To read more about regular expressions, see Regular Expressions.
If you do not have images in your requirements document, consider importing your requirements as plain text to prevent some issues related to font, style, or whitespace differences.
Import Options for Microsoft Excel Spreadsheets
You can import requirements in plain and rich text formats from Microsoft Excel spreadsheets. The plain text format imports only text and associates each column of your spreadsheet to a requirement property. The rich text format imports graphics, layouts, and captures multicell ranges.
If your Excel spreadsheet contains cells that are grouped and the group is collapsed, any requirements in cells that are not visible are not imported.
When you import requirements from Microsoft Excel files, you can identify requirements by specifying rows and columns, or you use a regular expression search pattern.
Identify Requirements by Specifying Rows and Columns
To identify requirements by specifying rows and columns, in the Importing Requirements dialog, under Requirement Identification, select Specify rows and columns.
Importing requirements with this method allows you to map columns to requirements properties and custom attributes when you click Configure columns. Under each column, you can select an item from the list. You must select a column to map to either Summary or Description. If you select
<Custom Attribute>, a custom attribute is registered for the requirement set with the custom attribute name specified by the column name. To read more about custom attributes for requirements, see Add Custom Attributes to Requirements.
Each column is imported as a separate specified property or custom attribute, with the exception of the Description and Rationale properties, which can combine multiple adjacent columns. When you select multiple columns for Description and Rationale, the value from each cell is concatenated into one field.
If you cannot map one of the columns in the spreadsheet to a column that holds unique requirement custom IDs, the import operation automatically generates unique custom IDs based on the rows in the spreadsheet. These custom IDs might not be persistent. If you explicitly select a column that does not have unique custom IDs, you cannot update the requirements document later.
You can exclude contents by ignoring columns and selecting only a range of rows to import. To ignore a column, select
<Ignore> from the drop-down menu at the top of that column. To import only a range of rows, under Specify rows to import, enter the row number to start at and end at.
You cannot maintain the hierarchy from your Microsoft Excel file when, under Requirement Identification, you select Specify rows and columns.
Identify Requirements by Regular Expression Search Pattern
To identify requirement by using a regular expression search pattern, in the Importing Requirements dialog, under Requirement Identification, select Use search pattern (REGEXP). To read more about regular expressions, see Regular Expressions.
The main advantage to using a regular expression search pattern is that you can retain the existing hierarchy when you import requirements from an Excel document if the matched requirement IDs are hierarchical. For example, the pattern
R[\d\.]+ will match requirements with IDs
R1, R1.1, R2, and so on, and
R1.1 will be recognized as a child of
R1. Additionally, you can selectively import requirements by importing only requirements that match the regular expression.