EDI File Joiner

Combine Separate EDI Files Into One



Main Features

  • Combine multiple EDI files into one EDI file
  • Combine multiple EDI strings into one in-memory string
  • Automatically handles ISA, ST, GS and IEA segment counts and control numbers
  • Combine files at the Functional Group (GS) or the Transaction (ST) level
  • Creates easy to read combined EDI data
  • Supports any X12 standard


EDIFileJoiner quickly and efficiently combines separate EDI files into one.  By allowing custom read and write buffer size EDIFileJoiner decreases IO and increases overall performance.  File joining is performed asynchronously on pooled threads to increase program responsiveness.

The Code

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
joiner.Join(files, "CombinedAll.txt");
private void joiner_OnFileOperationCompleted(object sender, FileOperationCompletedEventArgs e) {
   if (e.Status != FileOperationStatus.Success) {
     // Success