Joining files At Different Levels

Index

    Joining files At Different Levels

    EDIFileJoiner is capable of combining any number of X12 EDI files into one. The combining operation is asynchronous by nature allowing program flow to continue. You can combine EDI files at either the Interchange (ISA segment), Functional Group Level (GS segment) or at the Header Level (ST segment) by setting the FileJoinLevel property correctly.

    It is important to note that the ISA and IEA segments of the first EDI file in the group will be used in the resulting EDI output file whether joining is specified at the functional group or header level.
    It is also important to note that the EDIFileJoiner component is powerful enough to join X12 EDI files of different standards (i.e. 837, 834, 820) with completely different delimiter sets. It is recommended that only EDI files of the same standard and having the same delimiter set be combined however.

    Example

    EDIFileJoiner joiner = new EDIFileJoiner();
     
    // Join the files at the Functional Group Level (GS)
    joiner.FileJoinLevel = FileJoinLevel.FUNCTIONALGROUP;

    // 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
       }
    }

    Files can also be joined asynchronously using the async join methods.  Use the EachSegmentInNewLine property to make every segment appear in a new line.

    in EDI File Joiner
    Did this article answer your question?