Skip to main content
Solved

String Concatenator not outputting single result?

  • September 27, 2023
  • 2 replies
  • 32 views

parke372
Contributor
Forum|alt.badge.img+10

Hi, I have 2 attributes that are text from a pair of text files, i want to combine them into a single attribute.

 

I'm using an attribute text file readers to pick out the text, then creating an attribute for each of the text_line_data ouputs and naming them initial (first file contents):

 

imageFirst string contents:

******************************************************************************

  THE FIRE TROUBLE CIRCUIT IS REPORTING A MALFUNCTION! 

 ******************************************************************************

3

 

and extended (second file contents - second file's filename is contained inside the first file, hence the extra processing):

imageSecond file contents:

THIS INDICATES A MALFUNCTION OF THE FIRE SYSTEM

MONDAY THRU FRIDAY, 8:00 TO 4:30 PM, PLEASE NOTIFY Bob

MAINTENANCE DISPATCH AT XXX-XXXX

ALL OTHER TIMES, NOTIFY THE TELEPHONE OPERATOR.

 

 

i'm then using stringconcatenator to combine the two file's contents with a new line between:

 

imageMy expected result here would be - _results looking something like:

 

******************************************************************************

 THE FIRE TROUBLE CIRCUIT IS REPORTING A MALFUNCTION! 

 ****************************************************************************** 3

THIS INDICATES A MALFUNCTION OF THE FIRE SYSTEM

MONDAY THRU FRIDAY, 8:00 TO 4:30 PM, PLEASE NOTIFY Bob

MAINTENANCE DISPATCH AT XXX-XXXX

ALL OTHER TIMES, NOTIFY THE TELEPHONE OPERATOR.

 

 but i'm getting them as separate outputs:

image 

not sure where i am going wrong here?

 

Best answer by churchfraser

The StringConcatenator works by joining two fields within the same feature, rather than across features.

 

You could adapt your workspace by simply adding a FeatureMerger (Requestor =1, Supplier=1) right before your StringConcatentor. This will combine your two features into one feature, which can then be concatenated. imageimageNote that you may have to insert two New Lines into your StringConcatenator to emulate the above line break.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

churchfraser
Contributor
Forum|alt.badge.img+5
  • Contributor
  • 11 replies
  • Best Answer
  • September 27, 2023

The StringConcatenator works by joining two fields within the same feature, rather than across features.

 

You could adapt your workspace by simply adding a FeatureMerger (Requestor =1, Supplier=1) right before your StringConcatentor. This will combine your two features into one feature, which can then be concatenated. imageimageNote that you may have to insert two New Lines into your StringConcatenator to emulate the above line break.


parke372
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • 17 replies
  • October 3, 2023

The StringConcatenator works by joining two fields within the same feature, rather than across features.

 

You could adapt your workspace by simply adding a FeatureMerger (Requestor =1, Supplier=1) right before your StringConcatentor. This will combine your two features into one feature, which can then be concatenated. imageimageNote that you may have to insert two New Lines into your StringConcatenator to emulate the above line break.

oooooh. that would explain it. thanks, that worked perfect!