Loop thru all msg segments and send a single csv file #5207
Unanswered
Stonypaul1
asked this question in
Q&A
Replies: 2 comments 7 replies
-
perhaps using a globalChannelMap to keep concatenating to the final_output across messages until you are ready to write |
Beta Was this translation helpful? Give feedback.
3 replies
-
What is the ultimate objective here? Create a single CSV from a DB reader? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am retrieving 13 rows of data from a SQL Database in a Database Reader and using a Channel Writer am sending it on to a subsequent channel with a Channel Reader source. In the Transformer of the Channel Reader I am using the following JavaScript to try and generate a single CSV file but it doesn't work - all I get is 13 separate csv files with just the 13 header titles in them but no data.
I had this working before when everything was self contained, so I got the 13 rows and added them to a data variable and used while(data.next()) { } successfully, but .next() won't work with msg nor will while(msg.children().next()) { }.
I've tried for each(seg in msg.children()) and that gives me 13 csv files but this time with both the header and the data, but how do I create a single csv file with one set of headers and 13 rows of comma delimited data please? Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions