Skip to main content
Solved

String Concatenator not outputting single result?

  • September 27, 2023
  • 2 replies
  • 19 views

parke372
Contributor
Forum|alt.badge.img+8

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.

View original
Did this help you find an answer to your question?

2 replies

churchfraser
Contributor
Forum|alt.badge.img+5
  • Contributor
  • 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+8
  • Author
  • Contributor
  • October 3, 2023
churchfraser wrote:

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!

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings