EDI File Loader
Parse Any EDI Document Without Writing A Parser
EDIFileLoader provides a fast and easy way to parse and load any EDI document.
Main Features
- No need to write your own EDI parser
- Loads any ANSI X12 document
- Easily loop through each segment to access segment and element values
- Loads EDI documents from the file system or in-memory strings
- Exposes an array containing all lines of the loaded EDI document
- Creates an EDIDocument object after loading for easy access to EDI data
- Combine with EDIDocumentViewer to visually see and interact with all segments
- Ability to convert EDI document to XML
Details
Loading from a File or In-Memory String
EDIFileLoader gives you the flexibility to load data two ways: directly from a disk file using the EDIFile property, or straight from a text string using the EDIDataString property. This means you can process local files or real-time API data streams with equal ease.
Accessing Parsed and Loaded Data
EDIFileLoader bypasses all validation rules to give you instant, unrestricted access to your raw EDI data. Instead of forcing your file into a complex hierarchy, it parses every segment and element into a single, flat loop. This lightweight, rule-free approach eliminates strict schema constraints—giving you the ultimate flexibility to extract, manipulate, and consume data exactly how you want.
Grouping of EDI Envelopes
EDIFileLoader will create a different parent loop for each Interchange it encounters
Accessing Raw EDI Data
EDIFileLoader lets you instantly retrieve your raw data line-by-line using the EDIFileLines property. The engine maps your entire document into a simple string array, where each index represents a single line from the file. This gives you instant access to the exact text layout for quick auditing, debugging, or custom string manipulation..
Auto Detection of Delimiters
EDIFileLoader takes the guesswork out of file parsing with smart separator detection. If you already know your file delimiters, you can assign them manually using the Delimiter property. Alternatively, you can enable the AutoDetectDelimiters property—allowing the engine to automatically scan, identify, and apply the correct delimiter characters on the fly as the document loads..
Convert to XML
EDIFileLoader lets you instantly export your parsed data into standard XML format. Once your file is loaded, you can convert the entire payload into a clean XML structure with a single method call—making it effortless to integrate your EDI data with modern web services, databases, or API pipelines
The Code
// Create a new instance of EDIFileLoaderEDIFileLoader loader = new EDIFileLoader();
// Set the EDI file path to loadloader.EDIFile = "C:\\EDIFile.txt;
// Load the dataEDILightWeightDocument loadedDocument = loader.Load();
// Process all segments
foreach ( var segment in loadedDocument.Loops[0].Segments){ Console.WriteLine(segment.ToString());}

