Codepackr / edi / EDI Batch Splitter & Joiner

EDI Batch Splitter & Joiner

Split multi-transaction ANSI X12 and EDIFACT EDI files by Functional Group (GS/GE), Transaction Set (ST/SE), or PO/Claim numbers, and merge files with auto-recalculated envelopes.

Client-Side Execution & Privacy Guarantee

This utility executes 100% locally in your web browser. Your inputs, tokens, queries, and data payloads are never transmitted to any external server or backend.

Large EDI interchanges frequently contain dozens or hundreds of transaction sets inside one or more functional groups. The EDI Batch Splitter & Joiner extracts individual transactions or groups into separate files, or recombines previously split files into a single well-formed interchange, all inside the browser.

Control numbers, group counts, and interchange counts are recalculated on every join so the resulting envelopes remain consistent. The tool supports both ANSI X12 (ISA/GS/ST) and UN/EDIFACT (UNB/UNH) structures.

Splitting Strategies

Three common split points are supported. Functional-group splitting produces one file per GS/GE (or equivalent) pair, preserving the original group control numbers. Transaction-set splitting yields one file per ST/SE or UNH/UNT, each wrapped in its own minimal interchange if desired. Key-based splitting examines a user-specified element (purchase-order number, claim number, invoice number) and groups all related transactions that share that value.

When a single interchange contains multiple functional groups of different types, the tool can optionally keep only the groups that match a given functional identifier code (PO, IN, HC, etc.).

Joining and Envelope Recalculation

Joining accepts any number of previously split files. The tool extracts the inner transaction sets, discards the original envelopes, and builds a new ISA/GS or UNB wrapper. Interchange control numbers, functional-group control numbers, and transaction-set control numbers are assigned sequentially; SE01, GE01, and IEA01 (or their EDIFACT counterparts) are recomputed from the actual content.

Duplicate control numbers that would arise from naïve concatenation are eliminated. The user may supply a starting control number or let the tool generate one based on a timestamp.

Integrity Preservation

Segment terminators and element delimiters detected in the source files are retained in the output. Optional segments that appear only in some of the joined transactions are left untouched. The resulting file can be fed directly to an EDI validator or to a trading-partner gateway without further envelope surgery.

For EDIFACT, UNA service-string advice segments are normalized so that every output file uses a consistent delimiter set.

When to use this tool

  • Extract a single failed transaction from a large overnight batch for reprocessing.
  • Separate claims by provider or by patient control number before routing to different systems.
  • Reassemble daily order files that arrived as individual messages into one interchange for a legacy VAN.
  • Create unit-test fixtures by splitting a production file into one-transaction samples.
  • Merge acknowledgment files that were generated separately so they can be archived as a single interchange.

How to use the EDI Batch Splitter & Joiner

  1. Drop one or more X12 or EDIFACT files.
  2. Choose Split or Join.
  3. For split, select the criterion (functional group, transaction set, or element value) and the element path if needed.
  4. For join, confirm the order of files and supply an optional starting control number.
  5. Execute; each resulting file is listed with its new control numbers.
  6. Download the individual files or a zip archive of the whole set.

Worked examples

Split by transaction set

Input
ISA*00*          *00*          *ZZ*A*ZZ*B*240101*0000*U*00401*1*0*P*>~
GS*PO*A*B*20240101*0000*1*X*004010~
ST*850*0001~
BEG*00*SA*PO1**20240101~
SE*3*0001~
ST*850*0002~
BEG*00*SA*PO2**20240101~
SE*3*0002~
GE*2*1~
IEA*1*1~
Output
File 1:
ISA*00*          *00*          *ZZ*A*ZZ*B*240101*0000*U*00401*1*0*P*>~
GS*PO*A*B*20240101*0000*1*X*004010~
ST*850*0001~
BEG*00*SA*PO1**20240101~
SE*3*0001~
GE*1*1~
IEA*1*1~

File 2:
ISA*00*          *00*          *ZZ*A*ZZ*B*240101*0000*U*00401*2*0*P*>~
GS*PO*A*B*20240101*0000*2*X*004010~
ST*850*0001~
BEG*00*SA*PO2**20240101~
SE*3*0001~
GE*1*2~
IEA*1*2~

Each transaction receives its own interchange; control numbers are unique.

Join two single-transaction files

Input
File A contains one 850 for PO100; File B contains one 850 for PO200.
Output
ISA*00*          *00*          *ZZ*A*ZZ*B*240101*1200*U*00401*100*0*P*>~
GS*PO*A*B*20240101*1200*10*X*004010~
ST*850*0001~
BEG*00*SA*PO100**20240101~
SE*3*0001~
ST*850*0002~
BEG*00*SA*PO200**20240101~
SE*3*0002~
GE*2*10~
IEA*1*100~

New envelopes are built; GE01 equals the number of ST segments.

Common mistakes and tips

  • When splitting by a business key, verify that the chosen element appears at the same position in every transaction.
  • After joining, run the result through an EDI validator to confirm control-number consistency.
  • Preserve original filenames or add a suffix that includes the control number so later reconciliation is easier.
  • EDIFACT files that contain multiple UNH messages inside one UNB are split correctly; the UNA segment is copied to each output if present.
  • Very large batches (tens of thousands of transactions) are processed in a streaming fashion so browser memory stays reasonable.

Frequently asked questions

Can I split on a custom element such as a claim number?

Yes. Supply the segment ID and element position (for example CLM*01 or REF*02 with qualifier). All transactions sharing that value are written to the same output file.

Do original control numbers survive a split?

When splitting by functional group the original GS06 is kept. When splitting by transaction set new interchange and group numbers are assigned so each file is independently valid.

What happens if the joined files use different delimiters?

The tool normalizes everything to the delimiter set of the first file, or to a user-selected set, and rewrites the ISA or UNA accordingly.

Are functional acknowledgments (997/999) handled?

Yes. They can be split or joined like any other transaction set; the tool treats them as ordinary ST/SE groups.

Is there a limit on the number of files that can be joined?

Practical limits are set by available browser memory. Several hundred typical transaction files join without difficulty.