Skip to main content

I'm creating strings from feature with the StringConcatenator. Now I would like to group the feature-strings by an attribute with the Sampler. How can I add in front of each feature-group an additional string with the group attribute?

  • Is "'Feature 1 Attribute:A" a single concatenated string?
  • What result do you need to get after sampling?

 


  • Is "'Feature 1 Attribute:A" a single concatenated string?
  • What result do you need to get after sampling?

 

From each feature I generate a string (one row) which include the attribute of the feature. I would like to group these strings to send them to the text writer in the correct order. Additionally, I would like to add the grouping attribute in front of each string group as shown in the picture.

 

 


Change the question. Originally (i.e. before string concatenation), what attributes did the features have?

 

 


I'm guessing as below.

 

The original features have two attributes called "Feature" and "Attribute" - "Feature" can store sequential number 1, 2, 3, ..; "Attribute" can store a group name: "A" or "B".

 

The requirement is:

 

  • sort the features by group name and number
  • concatenate the attribute values to create a single string "Feature <number> Attribute:<group name>"
  • insert new features containing a string "Group <group name>" before every first feature for each group
  • finally write the strings into a text file
Am I right?

 

If I was wrong, please clarify the conditions and requirements.
I'm guessing as below.

 

The original features have two attributes called "Feature" and "Attribute" - "Feature" can store sequential number 1, 2, 3, ..; "Attribute" can store a group name: "A" or "B".

 

The requirement is:

 

  • sort the features by group name and number
  • concatenate the attribute values to create a single string "Feature <number> Attribute:<group name>"
  • insert new features containing a string "Group <group name>" before every first feature for each group
  • finally write the strings into a text file
Am I right?

 

If I was wrong, please clarify the conditions and requirements.

 

This sounds right!

Hi @nindalf, if I understood the requirement correctly, this workflow could be a solution.

uEdited]

0684Q00000ArLkwQAF.png

Source (CSV)

Feature,Attribute
1,A
10,B
2,A
9,B
3,A
8,B
4,A
7,B
5,A
6,B

Result (Text)

Group A
Feature 1 Attribute:A
Feature 2 Attribute:A
Feature 3 Attribute:A
Feature 4 Attribute:A
Feature 5 Attribute:A
Group B
Feature 6 Attribute:B
Feature 7 Attribute:B
Feature 8 Attribute:B
Feature 9 Attribute:B
Feature 10 Attribute:B

Reply