Skip to main content

Hello, I have this record: "50379(T)-50383(T)". What I would like to do, is to transform it into 5 records:

- 50379(T)

- 50380(T)

- 50381(T)

- 50382(T)

- 50383(T)

What is the easiest way to create this list? Thanks!

Hi @kat, if I understand the requirement correctly, this workflow might help you.

  1. StringSearcher: Extract the two number parts from the source string.
  2. Cloner: Create feature copies of the number of difference between the two numbers.
  3. AttributeCreator: Create desired value by concatenating the first number + copy number, and (T).


Find the first and last numbers, clone to get the right number of features then manipulate the attribute

Edit: Snap


I just mention it for completeness, but instead of the AttributeCreator I thought about using the Counter. Set Count Start to the first matched part, and _copynum for the counter name. No advantage or disadvantage, just different.

NB: Funnily we'd just talked at Safe about allowing more than one answer to be accepted. This is a perfect example of where this would be useful! Let me know if you think we should allow that (it's a simple switch) and how many answers we would allow to be accepted (we thought a maximum of two).


Nice question. It gets an upvote from me.

 


Reply