Skip to main content
Hi!

 

 

I want to map multiple attributes to one using the Schemamapper:

 

 

Ie:

 

 

InputFeature:

 

FirstName: Roger

 

Lastname: More

 

 

OutputFeature:

 

FullName: Roger More

 

 

How should the SchemaMapper.csv look like?

 

 

FullName, FirstName + LastName ???

 

 

 

 

Also tried:

 

@Value(FirstName)@Value(LastName),FullName
Hi, 

 

 

I always have to refer to http://fmepedia.safe.com/articles/Samples_and_Demos/Mapping-Schemas-using-SchemaMapper when using the SchemaMapper. Maybe, you can find your case in one of these examples? 

 

 

best regards, 

 

Jelle
Hi! Thanks for the reply - however as far as I can see none of those cases describe my case.

 

 

I want to "merge" two input-attributes (Firsname AND Lastname) to a new attribute (FullName)
Hi Sig,

 

 

In my testing, Tcl "concat" command worked well. @Evaluate(econcat @Value(FirstName) @Value(LastName)]),FullName   I'm not familiar with Tcl, cannot describe more details... By the way, why not use the StringConcatenator or the AttributeCreator?

 

Takashi
Hi Takashi!

 

 

I am aware how to do it within FME - however the reason the SchemaMapper exist is to separate the mapping from FME itself (ie let a domain-expert do the mapping in EXCEL and the FME-expert take care of the rest:)).

 

 

 


Another option I tried was to do the following in the CSV:

 

 

InputAttribute OutputAttribute Firstname FullName @Value(FullName) @Value(LastName)' FullName

 

However that did not seem to work either - as the last value overwrote the Firstname
Tcl "format" command also worked fine. It might be more flexible than "concat" command. @Evaluate([format "%s %s" @Value(FirstName) @Value(LastName)])   I agree with you. There could be such a situation - dividing roles by domain-expert and FME-expert.
Ah,great - now it works with both options! Just had to put the formula in "DEFAULTVALUE" - column and not InputAttribute. Thank you
I learned Tcl a little more. This expression also worked, for what it's worth.

 

@Evaluate((return "@Value(FirstName) @Value(LastName)"])

 

 

I've never used Tcl so far, but it seems to have big availability especially for string processing.
P.S. These are better if FirstName or LastName may contain a special character (" [ ]  <white space> etc.).

 

-----

 

@Evaluate(treturn {@Value(FirstName) @Value(LastName)}]) @Evaluate(tformat "%s %s" {@Value(FirstName)} {@Value(LastName)}]) @Evaluate(tconcat {@Value(FirstName)} {@Value(LastName)}])

 

-----

Reply