You are here: Workflows > TclCaller

TclCaller

Runs a Tool Command Language (Tcl) command and assigns its return value to an attribute.

TCL命令可以使用TCL语言提供的任何内置TCL功能,以及任何FME提供的TCL设施。

请参阅TCL语言参考手册(www.tcl.tk.) and theFME Tcl Variables and Functionssection below for details of the capabilities.

Common Tcl examples usage include:

  • 来自属性的修剪空格:

fme_setattribute tranmedAttribute [string trim [fme_getattribute workinalattribute]]

  • Replace all non-numeric characters with spaces in an attribute:

FME_SetAttribute anAttribute [regsub -all {[^0-9]} [FME_GetAttribute anAttribute] {}]

注意,在这种情况下,返回值是实际进行的替换数。

  • 匹配对属性的正则表达式:

Regexp {^ [a-za-z] $} [fme_getattribute anattribute]

这个正则表达式测试如果属性的整个值仅由字母字符组成。

请注意,匹配正则表达式时,如果表达式匹配,则返回值将为1,否则为0。

  • 记录日志窗口的自定义消息:

fme_logmessage fme_inform {这是我的消息}

制衡功能属性的推荐方法是通过为此目的提供的功能:

fme_getAttribute Attrname.

FME_SetAttribute attrName newVal

FME_CopyAttribute destAttrName srcAttrName

fme_renameattribute destattrname srcattrname.

fme_unsetattributesattrname1 [attrname2attrname3 ...]

Parameters

输出功能参数

Copy Control

先进的

FME Tcl Variables and Functions

使用说明

% Character

Due to FME parser limitations, a Tcl expression cannot contain a percent (%) character. If a % character is needed, the expression should be coded as a Tcl procedure and put into an external file to be 'source'd in. Note that you can avoid the % character issue by using astringformatter.变形金刚提供了访问TCL“格式”命令的便捷方式。

编辑变换器参数

Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, clickbeside the applicable parameter. For more information, see变压器参数菜单选项

变压器类别

Workflows

搜索FME知识中心

在上搜索有关此变压器的示例和信息FME Knowledge Center