17
votes

I've read XML or CSV before, but I've never seen anything like EDI.

How do I read this file and get the data that I need? I see things like ~, REF, N1, N2, N4 but have no idea what any of this stuff means.

I've seen somethings about x12 but don't know if thats what I have or not, how can I tell?

-- update

Thanks guys for the quick responses. Does anyone know of a parser that I can use in .Net? In the long run, I'm going to be converting this EDI file to a CSV file...

6
The X12 standard is well defined, you need to check the specs.Pablo Pazos

6 Answers

13
votes

EDI messages are defined by the X12 standard.

If you look for X12 parsers, you can find helpful information.

For example, http://code.activestate.com/recipes/299485/

3
votes

Those are ANSI X12 Files the standard is managed here http://www.wpc-edi.com/

Brief tutorial on structure

Hierarchy = Loops-> Segments -> Elements -> Sub Elements.

Loops are bounded either by control segments or logically based on the standard. Segments are separated by the segment terminator, by default ~ Elements are separated by the element separator, by default * Sub Elements are separated by sub element separator, by default :

3
votes

EDI is a delimited file format. You have to know both the line delimiter and the column delimiter (for lack of a better answer). You might, for example, see an EDI file with the following format (from http://www.slik.co.nz/HTML_help/edi_file_format.htm):

  HDR|6||||
  DTL|1|ABC|xyz|123|1
  DTL|13|ABC|animal|334|1
  DTL|11|ABC|sfdk|432|2
  DTL|12|ABC|wewdc|3|1
  DTL|14|ABC|qwdx|416|4

The first line is the header and tells you there are six records. The other lines are detail lines.

X12 is one standard used by EDI. You will see X12 used commonly in healthcare. If you have X12, you can examine the X12 standard to figure out how to parse.

3
votes

EDI stands for Electronic Data Interchange...

It's not a specific format per-se. Generally speaking it's a flat text file of data that usually has an associated published specification. For example: "Position 23-34 is the original price as a monetary value"

You really won't be able to do anything useful with an EDI file if you don't have the defined specification that goes along with it.

Once you get the specification, I believe how to read the file will be quite clear.

Generally the process is: 1. Read/Parse the EDI file. 2. Perform any processing/transformation on that data that you need to. 3. Persist it into your local system format (tables, other flat files, whatever).

Sorry there's not much more we could tell you unfortunately.

2
votes

EDI stands for “Electronic Data Interchange.” The practice involves using computer technology to exchange information – or data – electronically between two organizations, called “Trading Partners.” Technically, EDI is a set of standards that define common formats for the information so it can be exchanged in this way.

Read more: http://www.1edisource.com/learn-about-edi/what-is-edi#ixzz2g5E4p2ET

0
votes

EDI is just a flat file that contain some type of hierarchy. Usually companies buy EDI translator software to parse those files and extract data and then integrate with other systems. You can also use some type of service and they will do that for you. You can try to use Amosoft EDI Serices (www.amosoft.com) and they can help you with that.