Main Content

进口要求微软办公室文件

您可以在微软®单词and微软Excel®并将它们导入需求Toolbox™。导入要求时,您可以允许从微软办公软件documents, or you can import them without allowing updates. To read more about these import modes, seeSelect an Import Mode

To import requirements from a微软办公软件文档:

  1. 打开要求编辑。在Matlab®命令行,输入:

    slreq.editor

  2. 点击进口

  3. 设置文档类型Microsoft Word文档or微软ExcelSpreadsheet

  4. Next to the文档位置字段,单击Browseand select the desired file.

  5. 设置import options. To read more about import options for微软办公软件文件,请参阅进口Options for Microsoft Word DocumentsandMicrosoft Excel电子表格的导入选项。要了解有关导入要求集或参考要求的更多信息,请参见Select an Import Mode

  6. 点击进口导入要求。

进口Options for微软单词文件

You can import requirements in plain and rich text formats fromMicrosoft Worddocuments. Use the rich text format to import requirements that contain content such as graphics and tables.

当您从Microsoft Word文档,截面标题和数字填充IDandSummary田地和截面的身体填充了描述场地。要忽略导入要求中的截面号,请选择Ignore outline numbers in section headers。如果您选择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 yourMicrosoft Word文档,然后更新导入的要求。例如,当您在文档中间插入一个新部分时,“标题中的一些大纲编号”更改以反映新的部分编号。更新要求集时,需求工具箱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.

导入的要求层次结构与Microsoft Word文件标题层次结构。

当您导入要求时,建议选择使用书签来识别项目并用作自定义IDbecause the bookmarks are persistently stored in the document and cannot be duplicated.

选择时,您可以选择性地导入需求Identify items by occurrences of search pattern (REGEXP)and enter a regular expression search pattern. To read more about regular expressions, see常用表达

笔记

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.

进口Options for微软Excel电子表格

You can import requirements in plain and rich text formats from微软Excelspreadsheets. 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.

当您从微软Excel文件,您可以通过指定行和列来识别需求,或者使用正则表达式搜索模式。

Identify Requirements by Specifying Rows and Columns

To identify requirements by specifying rows and columns, in the Importing Requirements dialog, under需求识别, 选择指定行和列

使用此方法导入要求,您可以在单击时将列映射到需求属性和自定义属性配置列。Under each column, you can select an item from the list. You must select a column to map to eitherSummaryor描述。如果您选择<自定义属性>,为需求集注册了一个自定义属性,其中包含由列名指定的自定义属性名称。要了解有关需求自定义属性的更多信息,请参见Add Custom Attributes to Requirements

每列被导入为单独的指定属性或自定义属性,除了描述and理由属性,可以结合多个相邻列。当您选择多列描述and理由, the value from each cell is concatenated into one field.

如果您无法将电子表格中的列之一映射到具有唯一要求自定义ID的列,则导入操作会自动根据电子表格中的行生成唯一的自定义ID。这些自定义ID可能不会持久。如果您明确选择没有唯一自定义ID的列,则稍后将无法更新需求文档。

您可以通过忽略列并仅选择要导入的行范围来排除内容。要忽略一列,请选择<忽略>from the drop-down menu at the top of that column. To import only a range of rows, underSpecify rows to import, enter the row number to start at and end at.

笔记

You cannot maintain the hierarchy from your微软Excelfile when, under需求识别,您选择指定行和列

Identify Requirements by Regular Expression Search Pattern

To identify requirement by using a regular expression search pattern, in the Importing Requirements dialog, under需求识别, 选择使用搜索模式(REGEXP)。要了解有关正则表达式的更多信息,请参阅常用表达

使用正则表达式搜索模式的主要优点是,如果匹配的要求ID是层次结构,则可以从Excel文档导入要求时保留现有的层次结构。例如,模式R[\d\.]+will match requirements with IDsR1, R1.1, R2, and so on, andR1.1将被认为是R1。此外,您可以通过仅导入与正则表达式匹配的要求选择性地导入需求。

也可以看看

相关示例

更多关于