Main Content

本页采用了机器翻译。点击此处可查看英文原文。

Import File

将 ASCII 文本文件导入报告

描述

该组件将 ASCII 文本文件导入到报告中。

属性

  • 文件名:指定要导入到文本字段的文件的名称。您可以输入名称,或者使用浏览按钮(...)来查找文件。

    要在路径名中使用 MATLAB® 工作区变量,请使用符号 %<VariableName>。示例:

    • %<doc>

    • %<dir>/%<doc>

    • %<[dir,'/filename.txt']>

    • %<dir>/filename.txt

  • 将文件导入为:指定导入文件的格式。选项包括:

    • 纯文本(忽略换行符):将文件导入为纯文本,不带任何换行符(无段落)。如果选择此选项,导入文件组件将像文本组件一样运行,因此它应该以段落组件作为其父组件。

      本节中的示例使用以下文本作为输入文件:

      This is the first row of text from the imported file.
      The second row follows a line break in the first row.
      
      There is a blank line above the third row.
      

      纯文本(忽略换行符) 为示例文件生成以下格式:

      This is the first row of text from the imported file. 
      The second row follows a line break in the first row. 
      
      There is a blank line above the third row.
      
    • 由换行符定义的段落:将文件作为文本导入,段落中有换行符(硬回车或回车)。此选项将为示例文件生成以下格式:

      This is the first row of text from the imported file.
      The second row follows a line break in the first row.
      
      There is a blank line above the third row.
      

    • 由空行定义的段落:将文件作为文本导入,段落中包含空行(不包含文本的行)。此选项将为示例文件生成以下格式:

      This is the first row of text from the imported file. 
      The second row follows a line break in the first row.
      
      There is a blank line above the third row.
      

    • 文本(保留换行符) (默认):将文件导入为带换行符的纯文本。此选项将为示例文件生成以下格式:

      This is the first row of text from the imported file.
      The second row follows a line break in the first row.
      
      There is a blank line above the third row.
      

    • 等宽文本(保留换行符):将文件导入为固定宽度的文本(所有字母具有相同的宽度或大小),包括换行符。此选项对于导入 MATLAB 文件很有用。此选项将为示例文件生成以下格式:

      This is the first row of text from the imported file. 
      The second row follows a line break in the first row.
      
      There is a blank line above the third row.
      

    • DocBook XML:插入 XML 源文件,但不更改其格式。

    • 格式化文本(HTML/RTF):插入 RTF 或 HTML 源文件,但不更改其格式。

    • 语法高亮的 MATLAB 代码:插入 MATLAB 文件。

    文件内容字段显示要导入的文件的前几行。

是否在报告中插入内容?

是。

  • 如果选择以下选项之一,则插入文本:

    • 纯文本(忽略换行符)

    • 文本(保留换行符)

    • 等宽文本(保留换行符)

  • 如果选择以下选项之一,则插入段落:

    • 由换行符定义的段落

    • 由空行定义的段落

  • 如果选择 DocBook XML 选项,则插入 XML 文件的内容。

  • 如果选择格式化文本(HTML/RTF) 选项,则插入 RTF 或 HTML 文件的内容。

  • 如果将文件导入 HTML 报 告,则插入文件链接。

rptgen.crg_import_file