Skip to main content

I have tried all the ways I could think of to do this but cannot find anything on how to change a text field to an integer field like in ArcGIS Pro. Please help! This is what I have tried:

@int(USER_Price)

@int(@replace(@replace(USER_Price, "$", ""), ",", ""))

 

I have also tried @Trim which produced a 3 digit result.

Hi @vladimirb777​ 

 

Please, see the attached Workspace.

 

Thanks in Advance,

Danilo


You could use the \W (note upper case) regex to match all non-numbers and replace with an empty string. This can be implemented with the StringReplacer or as an expression in e.g. the AttributeManager:

@ReplaceRegularExpression("@Value(USER_Price)","\W","",caseSensitive=FALSE)

 Documentation: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/!Transformer_Parameters/StringFunctions.htm


After looking over more FME tutorials I realized I was using the wrong tool in Attribute Manager and that the appropriate tool to use is the Text Editor. I ended up figuring it out, but thank you to the other respondents for answering my question! The code that yielded the result I wanted was as follows:

@Trim(@ReplaceString(@Value(USER_Price),",","",caseSensitive=TRUE), "$","")


Reply