你在这里: Lists listsorter.

listsorter.

对给定列表的元素进行排序。排序可以是字母或数字,并且以升序或降序为单位。

Input Ports

输出端口

参数

Examples

如果输入功能具有这些属性:

somelist{0} = 3

somelist{1} = 17

somelist{2} = 4

索音{3} = 9

somelist{4} = 2

并且列表名称设置为SOMELIST {},然后离开变压器的功能将具有以下属性:

somelist{0} = 2

somelist{1} = 3

somelist{2} = 4

索音{3} = 9

somelist{4} = 17

请注意,如果有其他属性st "parallel" to the attribute being operated on, these will also be moved in the list to stay in "parallel" with the key attribute.

For example, if the input feature had these attributes:

somelist{0}.kind = 'paved'

索音{0} .count = 3

索音{1} .kind ='shovell'

索音{1} .count = 17

somelist{2}.kind = 'trail'

索音{2} .count = 4

somelist{3}.kind = 'rough'

索莫斯{3} .count = 9

somelist{4}.kind = 'logging'

索音{4} .count = 2

并且列表名称设置为SOMELIST {}。计数,然后离开变压器的功能将具有以下属性:

SOMELIST {0} .kind ='logging'

索音{0} .count = 2

somelist{1}.kind = 'paved'

somelist{1}.count = 3

somelist{2}.kind = 'trail'

索音{2} .count = 4

somelist{3}.kind = 'rough'

索莫斯{3} .count = 9

索音{4} .kind ='smooth'

SOMERIST {4} .COUNT = 17

Lastly, if the original list was sparse, that is, it was missing some elements, the sorting operation will have the side effect of compacting the list to make all elements have consecutive indices. For example, if the input feature had these attributes:

somelist{0}.kind = 'paved'

索音{0} .count = 3

somelist{3}.kind = 'rough'

索莫斯{3} .count = 9

somelist{4}.kind = 'logging'

索音{4} .count = 2

并且列表名称设置为SOMELIST {}。计数,然后离开变压器的功能将具有以下属性:

SOMELIST {0} .kind ='logging'

索音{0} .count = 2

somelist{1}.kind = 'paved'

somelist{1}.count = 3

somelist{3}.kind = 'rough'

索莫斯{3} .count = 9

Additional Resources

More Information on Lists

Editing Transformer Parameters

使用一组菜单选项,变压器参数s 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, click除适用的参数旁边。有关更多信息,请参阅Transformer Parameter Menu Options

Transformer Categories

Lists

Search FME Knowledge Center

Search for samples and information about this transformer on theFME知识中心