Skip to content

Splitting transactions into separate edi files #387

Answered by MikeEdgar
hancockks asked this question in Q&A
Discussion options

You must be logged in to vote

Since I don't need to break down anything beyond a list of segments within each transaction, is there a way to configure the stream reader to just read a composite as a single segment text section?

Hi @hancockks , do you need to just list the segment tags or are you also using the element data?

To answer your question, there isn't any configuration option for that, but you could easily use a StringBuilder for it. When your application encounters a START_COMPOSITE event, set the length of the builder to 0. Then, for each ELEMENT_DATA event, append the text from the event. Finally, use the value from the builder when END_COMPOSITE occurs.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hancockks
Comment options

Answer selected by hancockks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants