Skip to main content

I have an excel containing 3 columns with name of Belgian commune in 3 format : one with dash (ex Saint-Nicolas), one its regex counterpart (\\bSaint-Nicolas\\b), and one without dash (Saint Nicolas). My goal is to replace, in a feature layer, the attribute with the dash by the one without the dash. So, for this, I am using a conditional replacement in attributeManager, but it fails ( @ReplaceString(@Value(attributeToReplace),@Value(xls_regex),@Value(xls_FinalName),caseSensitive=TRUE). It seems that it doesn't recognize that the attribute fulfill the condition. But, if I put my condition manually, one commune at a time (attributeToReplace Contains \\bSaint-Nicolas\\b, etc.), it does work !

 

What am I missing here ?

You need to use ReplaceRegEx if you want to replace regex

@ReplaceRegEx(@Value(attributeToReplace),@Value(xls_regex),@Value(xls_FinalName),caseSensitive=TRUE)

 

 


You need to use ReplaceRegEx if you want to replace regex

@ReplaceRegEx(@Value(attributeToReplace),@Value(xls_regex),@Value(xls_FinalName),caseSensitive=TRUE)

 

 

 

Thx for your supportReplaceRegExThat's also what I did, but it seems that it doesn't recognise that the xls_regex value is contained in attributeToReplace.

However, If I "hardcode" the regex value to be replaced, let's say \bBeyne-Heusey\b, it's ok. So I guess the regex value from the xls file is not read as expected.

 


Your statement won't work as the features containing the text to replace don't also contain the regex.