EDI File Loader

Want to see what’s in your EDI files without writing a parser?

EDIFileLoader provides a fast and easy way to parse and load ANY EDI file.

Main Features

  • No need to write your own EDI parser
  • Loads any X12 or EDIFACT EDI file
  • Creates an EDIDocument object after loading for easy access to EDI data
  • Easily loop through each segment in an EDI file to access EDI data segments and element values
  • Loads EDI data from the file system or in-memory strings
  • Auto detection of segment, element and composite delimiters
  • Loads EDI files without any rules files whatsoever
  • Exposes an array containing all lines of the loaded EDI file
  • Ability to convert EDI data to XML
  • Easy to use API

Details

No Rules File Required

EDIFileLoader, unlike the EDIValidator component, does not require any rules files.  It instead uses general parsing and loading techniques to parse and load EDI files.  It automatically finds the terminator characters and creates an EDIDocument.

Loading from a File or In-Memory String

EDIFileLoader can load EDI files from the file system using the EDIFile property as well as from a string of EDI data using the EDIDataString property.

Accessing Parsed and Loaded Data

Accessing EDI data is easy.  Because EDIFileLoader does not use any rules file, there is no validation on the EDI data.  More importantly there is no proper hierarchy data conforming to the EDI implementation guides as you would find in the EDIValidator component.  There is only one main loop containing all the parsed segments and elements that exist in the EDI file.  This gives developers the flexibility to consume this data however they please.

EDIFileLoaderEDIFileLoader_EDIFACT

Grouping  of EDI Envelopes

EDIFileLoader will create a different parent loop for each ISA interchange it encounters

loaderFlatStructure3

Accessing Raw EDI Data

EDIFileLoader allows you to retrieve the raw EDI file data after validation.  The raw EDI data is placed in an array.  Each index represents one line from the EDI file.  EDIFileLoader has this data available through the EDIFileLines property.

Auto Detection of Delimiters

EDIFileLoader has a Delimiter property that can be set if these delimiters are known beforehand.  It also has a property called AutoDetectDelimiters.  By enabling this property EDIFileLoader detects the special delimiter characters while loading is being performed.  Parsing is then performed from this point as usual.

Convert to XML

EDI data can be converted to XML after loading

Example

// Create a new instance of EDIFileLoader
EDIFileLoader loader = new EDIFileLoader();

loader.AutoDetectDelimiters = true;

// Set the type of EDI file that you are about the load
loader.EDIFileType = FileType.X12; //Or FileType.EDIFACT

// Set the source of EDI data, whether you are loading from an in-memory string or a file
loader.EDISource = EDISource.File; // Or EDISource.DataString

// Set the EDI file path to load
loader.EDIFile = "C:\\EDIFile.txt;

// load the data
EDILightWeightDocument loadedDocument = loader.Load();

 

EDIFileLoader is included in RDPCrystal EDI Library