span8
span4
大家好,我对亚搏国际在线官网fme很陌生,我遇到了一些可能比我想象的要简单的事情。基本上,我有一个填满的access数据库表,我试图将这些填满的记录放入一个模板表中。这个模板的列标题/属性名比源的少。我试图获得那些不再有地方放入字符串的值。我已经做到了这一点,但我试图让这个长字符串可读的属性值先由属性名。我将给出一个例子:(抱歉,我目前只在移动设备上,所以写出来有点困难)
旧
水果蔬菜杂粮汤
苹果菜花面包西红柿汤
新:
水果蔬菜等
苹果菜花谷类:面包,汤:西红柿汤
这只是一个例子。真正的表有像每有以适应30.我希望任何人记录52场可以帮助我。
你好@senteria,如果你知道哪个属性应纳入“其他”栏,你可以创建AttributeManager(或AttributeCreator或StringConcatenator)所需的值,如:
You can use the Schema Reader to read schema from the source table and the template table, create a list attribute (e.g. "_other{}.name") containing attribute names that should be aggregated into the "other" attribute, and then merge the list to every data feature unconditionally, with this workflow for example.
在此之后,但是,我认为你必须写一个脚本(Python的,TCL左右)打造的“其他”属性。
PythonCaller脚本示例:
DEF aggregateOthers(功能):项= [] ATTRS = feature.getAttribute( '_其它{}名称。'),用于在ATTR ATTRS:值= feature.getAttribute(ATTR)items.append( '%S:%s' 的%(ATTR,值))feature.setAttribute( '其他', ''。加入(项目))
除了这个脚本联合收割机“其他”属性空值,失踪,空和数字0。如果它是确保每一个属性从不存储数字0,这个脚本就足够了。
DEF aggregateOthers(功能):项= [] ATTRS = feature.getAttribute( '_其它{}名称。'),用于在ATTRS ATTR:值= feature.getAttribute(ATTR)如果值:items.append(“%S:%s的'%(ATTR,值))feature.setAttribute(' 其他 '',”。加入(项目))
但是,如果属性可能包含数字0,多一点严格的条件表达式将是必需的,是这样的。
DEF aggregateOthers(功能):项= [] ATTRS = feature.getAttribute( '_其它{}名称。'),用于在ATTRS ATTR:值= feature.getAttribute(ATTR)如果值=无和值= '':!项.append( '%S:%s' 的%(ATTR,值))feature.setAttribute( '其他', ''。加入(项目))
©2020安全亚搏在线软件公司|法律