EDIFileJoiner is capable of joining any number of X12 EDI files into one. The joining operation is asynchronous by nature allowing program flow to continue.
EDIFileJoiner joiner = new EDIFileJoiner();
joiner.AutoDetectDelimiters = true;
// Join the files at the ST header level
joiner.FileJoinLevel = FileJoinLevel.HEADER;
// Subscribe to be notified when the joining operation is complete
joiner.OnFileOperationCompleted += new EventHandler(joiner_OnFileOperationCompleted);
// Specify the list of files to join
List files = new List();
// Join the EDI files
private void joiner_OnFileOperationCompleted(object sender, FileOperationCompletedEventArgs e)
if (e.Status != FileOperationStatus.Success)
Files can also be joined asynchronously using the async join methods. Use the EachSegmentInNewLine property to make every segment appear in a new line.