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?
Page 1 / 1
- 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?
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
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
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]
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