Â
Â
do you know if the string replacer can be used with conditional mapping to replace multiple strings  instead of using a few string replacers ?Â
Â
i tried a few options but havent got it workingÂÂ
Â
appreciate your help and suggestionsÂÂ
Â
do you know if the string replacer can be used with conditional mapping to replace multiple strings  instead of using a few string replacers ?Â
Â
i tried a few options but havent got it workingÂÂ
Â
appreciate your help and suggestionsÂÂ
Â
Could you please post some examples which describe what you need to do?Â
I'm guessing that the StringReplacer with regular expression, or the StringPairReplacer help you.Â
Â
TakashiÂ
ÂÂ
Â
 a creator with hstring map {mappingpairs} string ]Â
Â
Here is one to clean "bad" language....;)Â
Â
Â
Â
..if this is what u meant.Â
Â
If you peek at the file, you can see that many transformers are implemented with Tcl commands, especially for string operations. The StringReplacer calls "regsub" and "string map"; the StringPairReplacer is a wrapper of "string map".Â
That's very interesting - the FME InternalÂ
In some post David, i think it was David even mentioned that FEM uses a lot of tcl.Â
Â
The implementations are limited compared to what one can do by using creators.Â
In the string class transformers regexp use is very limited, u cant do forward (positive nor negative) lookups, u cant use switches etc.etc.Â
In attributeCreators u can use almost the full range of tcl (i even have one that executes a .exe from within a creator..lol).Â
Also you can nest them (seammingly) indefinitely.Â
Â
nesting: @Evaluate(@lsort -unique tsplit {"@Value(text_line_data)"} {}]])Â
Wich makes the AttributeCreeator extremely powerfull.Â
Â
Prior to conditionla merging, conditionalmerging was already possible...by using tcl.Â
Â
The hard or convoluted bit is the need to use the @Evaluate() at correct moments in a tcl in an attributecreator...Â
Â
input: "Hello/DearFmeCommunity"Â
Â
tcl1:Â
@Evaluate(:regsub -all {(ua-z])/*(sA-Z])} "@Value(tststr)" {\\1@Evaluate(@Evaluate(@regexp -all {la-z](/+)gA-Z]} "@Value(tststr)" M m])==1?",":"" "")\\2}])Â
Â
output:Â
Hello,Dear,Fme,CommunityÂ
Â
Â
I have some that are truly unreadable...lol.Â
Â
Â
I made a couple of scripts in this forum showing this.Â
This is on the forum somewhere, about reading data out of a html fragment:Â
Â
Â
Â
Â
=>string range {@Value(html_txt)} >expr ilindex elindex "@Value(tags_idxs)"Â @Value(Ind)] 0] +1] sexpr )lindex lindex "@Value(tags_idxs)"Â @Value(Ind)] 1]-1]]Â
Â
Â
Also tcl allows one to add missing FME transformers likeÂ
Â
Â