Skip to main content

Hi

I want to edit a few thousand attributes, basically adding a number of 0's in the middle and end of a string. For example I want 2017_420590 to become 2017_420000_590000.

I think I may have to use the StringFormatter to edit the string use regexpr, I am not experienced using regexpr however.

Thanks for any help in advance.

B

I don't think you can use regular expressions in the StringFormatter. You can probably use the StringReplacer to achieve the same thing, however.

What's the rule for where and when to intruduce the zeros?


I don't think you can use regular expressions in the StringFormatter. You can probably use the StringReplacer to achieve the same thing, however.

What's the rule for where and when to intruduce the zeros?

Ah okay, sorry new to this. How would you suggest undertaking the problem?

 

 


Ah okay, sorry new to this. How would you suggest undertaking the problem?

 

 

If you can give us the rules for where and when you need to insert the zeros, that would be helpful. A couple of examples of before and after-values would also be nice.
If you can give us the rules for where and when you need to insert the zeros, that would be helpful. A couple of examples of before and after-values would also be nice.
Okay.

 

I would like the attribute value 2017_420590 to become 2017_420000_590000.

 

 

So the addition of three 0's after every 8th character, next the addition of an _ after the 3 0's. Then finally 3 0's at then end of the string.

 

 

I hope this is what you are asking and makes sense, sorry can be tough to explain.

 

 

Thanks for the help.

 


Try the following in a StringReplacer:

Text to replace:   ^(.{8})(.*)
Replacement text:  \1000_\2000

Example:

0684Q00000ArKBDQA3.png


Try the following in a StringReplacer:

Text to replace:   ^(.{8})(.*)
Replacement text:  \1000_\2000

Example:

0684Q00000ArKBDQA3.png

Perfect, thanks for the excellent and fast help. You are very good. :)

 

 


I think you can use AttributeManager text editor with the following expression:

@ReplaceRegEx(@ReplaceRegEx(@Value(_creation_instance),(?<=^.{8}),_),(?<=^.{8})|(?<=0$),000)

0684Q00000ArK3OQAV.jpg

0684Q00000ArK0PQAV.jpg

attribute-editing.fmw

Edit: Including workspace