EDI File Joiner
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
Details
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();
// 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();
files.Add("834_1.txt");
files.Add("834_2.txt");
files.Add("834_2ST.txt");
files.Add("834_5010.txt");
// Join the EDI files
joiner.Join(files, "CombinedAll.txt");
private void joiner_OnFileOperationCompleted(object sender, FileOperationCompletedEventArgs e)
{
if (e.Status != FileOperationStatus.Success)
{
// Success
}
}