Can you not just write out the source and desitination attributes to a csv after passing through a duplicate remover?
Sameway you can use filewriter to write destination vlaues after the Valuemapper.
Of course it is somewhat more handy to create the ValueMap in a txt-file int he first place..
I have this same problem, except I don't have a source dataset with all the values in it.
Just inherited an AttributeValueMapper with a long list of Source and Destination values (about 300), and now have no way of getting them out of there. Any suggestions? Maybe @takashi knows?
And this is exactly why you should use a Joiner, joining for example to CSV or Excel, instead of an AttributeValueMapper if you have a large number of values you want to map.
I have this same problem, except I don't have a source dataset with all the values in it.
Just inherited an AttributeValueMapper with a long list of Source and Destination values (about 300), and now have no way of getting them out of there. Any suggestions? Maybe @takashi knows?
And this is exactly why you should use a Joiner, joining for example to CSV or Excel, instead of an AttributeValueMapper if you have a large number of values you want to map.
I do have a quick (and dirty) workaround for this:
Copy the AttributeValueMapper in the workspace to the clipboard.
The open a text editor (notepad or similar) and paste from the clipboard.
This will give you the definition of the transformer (including a list of all values) in text format.
This can be read (after a little editing) using the CSV reader.
I do have a quick (and dirty) workaround for this:
Copy the AttributeValueMapper in the workspace to the clipboard.
The open a text editor (notepad or similar) and paste from the clipboard.
This will give you the definition of the transformer (including a list of all values) in text format.
This can be read (after a little editing) using the CSV reader.
The attachment is an experimental workspace, which demonstrates a possible way to parse a workspace (*.fmw) with the FMW reader, extract source/destination values from AttributeValueMapper parameters setting, and decode them.
extract-mapping-table-from-attributevaluemapper.fmw (FME 2016.1.3.1)
Next to the joiner another possibility to use the external mapping file is the SchemaMapper.
I usually try to avoid the AttributeValueMapper as much as possible and just use it in 'throw away' workspaces.
I do have a quick (and dirty) workaround for this:
Copy the AttributeValueMapper in the workspace to the clipboard.
The open a text editor (notepad or similar) and paste from the clipboard.
This will give you the definition of the transformer (including a list of all values) in text format.
This can be read (after a little editing) using the CSV reader.
@takashi
The workspace you provided is excellent, thanks.
But I also found another simple way to avoid the problem of coding,
That is, first create the Summary Annotation for AttributeValueMapper, and then copy the Annotion paste into the text editor.
@takashi
The workspace you provided is excellent, thanks.
But I also found another simple way to avoid the problem of coding,
That is, first create the Summary Annotation for AttributeValueMapper, and then copy the Annotion paste into the text editor.
@takashi
The workspace you provided is excellent, thanks.
But I also found another simple way to avoid the problem of coding,
That is, first create the Summary Annotation for AttributeValueMapper, and then copy the Annotion paste into the text editor.
@takashi
The workspace you provided is excellent, thanks.
But I also found another simple way to avoid the problem of coding,
That is, first create the Summary Annotation for AttributeValueMapper, and then copy the Annotion paste into the text editor.
found that there is another way, directly open the workspace(*.fmv) with a
text editor, Find the desired row by searching for a list value, and then copy the required content.
The advantage of this method is not only can be applied to Transformer,
can also be applied to user parameters, For example, get the values of choice type parameters etc.
found that there is another way, directly open the workspace(*.fmv) with a
text editor, Find the desired row by searching for a list value, and then copy the required content.
The advantage of this method is not only can be applied to Transformer,
can also be applied to user parameters, For example, get the values of choice type parameters etc.
#! <XFORM_PARM PARM_NAME="LUT" PARM_VALUE="<u65e5><u672c><u8a9e>,<u6bcd><u56fd><u8a9e>,<u82f1><u8a9e>,<u5916><u56fd><u8a9e>"/>
I don't know an easy way to decode them, other than using FME predefined Tcl FME_DecodeText function.
#! <XFORM_PARM PARM_NAME="LUT" PARM_VALUE="<u65e5><u672c><u8a9e>,<u6bcd><u56fd><u8a9e>,<u82f1><u8a9e>,<u5916><u56fd><u8a9e>"/>
I don't know an easy way to decode them, other than using FME predefined Tcl FME_DecodeText function.
from fmeobjects import FMESession
def DecodeText(feature):
text = feature.getAttribute('text')
decoded_text = FMESession().decodeFromFMEParsableText(text)
feature.setAttribute('text', decoded_text)
Returns:
`text' has value `="???,???,??,???'
Hopefully it's correct!
#! <XFORM_PARM PARM_NAME="LUT" PARM_VALUE="<u65e5><u672c><u8a9e>,<u6bcd><u56fd><u8a9e>,<u82f1><u8a9e>,<u5916><u56fd><u8a9e>"/>
I don't know an easy way to decode them, other than using FME predefined Tcl FME_DecodeText function.
However,
you can use the first method to get the list value of transformer, and
use second methods to get values of user parameters.
In
addition, I query some information, as well as after testing, found
that Python can be relatively simple to restore these characters.
def processFeature(feature): s= u'\u65e5\u672c\u8a9e' feature.setAttribute("attr",s)
It will get result '???'.
#! <XFORM_PARM PARM_NAME="LUT" PARM_VALUE="<u65e5><u672c><u8a9e>,<u6bcd><u56fd><u8a9e>,<u82f1><u8a9e>,<u5916><u56fd><u8a9e>"/>
I don't know an easy way to decode them, other than using FME predefined Tcl FME_DecodeText function.
Attached is a workspace (FME 2016.1.3+ required) that uses the workspace reader to export all the AttributeValueMapper settings of a specified workspace to a CSV file. The resulting CSV file has a column for the transformer name and the source and destination values. It should be handling international characters just fine (but do let me know if it doesn't).
Sample input:
Output generated by exportattributevaluemapper.fmw, as imported into Excel:
It should be fairly simple to extend so as to include the default values as well as the source and destination attribute names.
Main workspace: exportattributevaluemapper.fmw
Test workspace: avm.fmw
Output from test workspace: attributevaluemappersettings.csv
Attached is a workspace (FME 2016.1.3+ required) that uses the workspace reader to export all the AttributeValueMapper settings of a specified workspace to a CSV file. The resulting CSV file has a column for the transformer name and the source and destination values. It should be handling international characters just fine (but do let me know if it doesn't).
Sample input:
Output generated by exportattributevaluemapper.fmw, as imported into Excel:
It should be fairly simple to extend so as to include the default values as well as the source and destination attribute names.
Main workspace: exportattributevaluemapper.fmw
Test workspace: avm.fmw
Output from test workspace: attributevaluemappersettings.csv
#! <XFORM_PARM PARM_NAME="LUT" PARM_VALUE="<u65e5><u672c><u8a9e>,<u6bcd><u56fd><u8a9e>,<u82f1><u8a9e>,<u5916><u56fd><u8a9e>"/>
I don't know an easy way to decode them, other than using FME predefined Tcl FME_DecodeText function.
Attached is a workspace (FME 2016.1.3+ required) that uses the workspace reader to export all the AttributeValueMapper settings of a specified workspace to a CSV file. The resulting CSV file has a column for the transformer name and the source and destination values. It should be handling international characters just fine (but do let me know if it doesn't).
Sample input:
Output generated by exportattributevaluemapper.fmw, as imported into Excel:
It should be fairly simple to extend so as to include the default values as well as the source and destination attribute names.
Main workspace: exportattributevaluemapper.fmw
Test workspace: avm.fmw
Output from test workspace: attributevaluemappersettings.csv
David, This is awesome. Thank you so much for sharing.