HIPAA EDI Development Suite

EDI File Splitter

Large EDI file causing you problems? Just split it!

The libraries are proving to be invaluable to our project



Main Features

  • Split large X12 EDI files into smaller, more manageable ones
  • Split X12 files at the Envelope Level (ISA), Functional Group level (GS) or the Header level (ST)
  • Specify how many headers or functional groups should go in each file
  • Customizable output filenames and extensions
  • Auto placement of segment, transaction and functional group counts in the SE, GE and IEA segments
  • Asynchronous file read and write operations


It may be more efficient to process smaller EDI files than one large file in some circumstances.  For example, with multiple EDI files multi-threaded techniques can be employed to speed up overall load time. Some system also work faster with smaller files.  EDIFileSplitter can split large EDI files into smaller ones.  It’s a high-speed multi-threaded splitter that can split on a message level or functional group level.  The number of (GS) functional groups or (ST) header that each file can contain is configurable.  Memory usage is transient and does not depend on how much RAM is available.  Because input and output buffer sizes can be customized there are less IO calls and overall performance is increased.

Files can also be split in asynchronous mode.  An event is then thrown when the split operation is complete.  Output file names and extensions are customizable.  The current date can be appended to the name of each generated file.  The date string is guaranteed to be unique.

Auto Placement of Number of Segments, Transactions and Functional Headers

SE segments must contain the total amount of segments used within that specific header.  EDIFileSplitter will automatically keep a count of the number of segments used in the header and goes as far as to actually enter that data in the SE segment.  Additionally the number of ST transactions and GS Functional Groups are also tracked and added to the GE and IEA segments


EDIFileSplitter ediFileSplitter = new EDIFileSplitter();

// Split the file at the header level (ST segment)
ediFileSplitter.FileSplitLevel = FileSplitLevel.HEADER;

// Place 2 ST headers per file
ediFileSplitter.NumberOfItemsPerFile = 2;
ediFileSplitter.OnFileOperationCompleted += new EventHandler(splitter_OnFileOperationCompleted);

   string currentDirectory = Directory.GetCurrentDirectory();
   ediFileSplitter.Split("837P_2ST_SE_Loops.txt", currentDirectory);
catch (Exception ex)

private void splitter_OnFileOperationCompleted(object sender, FileOperationCompletedEventArgs e)
    if (e.Status != FileOperationStatus.Success)
       MessageBox.Show("Error splitting file", "Error");
    else if (e.Status == FileOperationStatus.Success)
       MessageBox.Show("File Split Success", "Success");

Example Usage with file

You may need to split an EDI  file in multiple files for a variety of reasons.  EDIFileSplitter can help you accomplish this quickly and efficiently.

The following EDI file is an X12 837P EDI file that contains 2 ST headers.  This file can be split easily into two files with 1 ST header each.

Original EDI File

After using the EDIFileSplitter component the following two files are created:



There are now two separate files.  In this quick example we split the original file on the ST header with one ST header per file.  With EDIFileSplitter we can also split on the Interchange Envelope (ISA) and Functional Header (GS). We can also specify how many ST headers or GS headers should go in each file.

Take Charge Of HIPAA

RDPCrystal EDI Library