17

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...

Miles
  • 5,646
  • 18
  • 62
  • 86

6 Answers6

13

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/

S.Lott
  • 384,516
  • 81
  • 508
  • 779
  • 5
    +1. Definitely do NOT write your own X12 parser. Not that it's too difficult, just that it would be insane to recreate work that's been done and tested so many times before. – Joel Coehoorn Mar 09 '09 at 14:50
  • 8
    Not all EDI messages are X12 standard. – Gregory A Beamer Mar 09 '09 at 14:54
  • @Gregory A Beamer. What do you suggest the alternatives are? – S.Lott Mar 09 '09 at 16:10
  • @S.Lott : As X12 is the standard in north America, Edifact is the standard in Europe and XML is the standard in Latin America. – ArcDare Jun 18 '12 at 21:47
  • 2
    Tradacoms is still prevalent in the UK. There are a whole raft of XML based formats aimed at different industries and different parts of the world (e.g. ebXML, BASDA, RosettaNet). I've come across standards specific to Japan in the past - I imagine they are still in use, and the same is probably true for lots of other countries too. There are lots. – Giles Oct 03 '14 at 14:35
3

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 :

cmsjr
  • 56,771
  • 11
  • 70
  • 62
3

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.

Gregory A Beamer
  • 16,870
  • 3
  • 25
  • 32
3

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.

Macon Pegram
  • 256
  • 1
  • 4
2

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

kwed
  • 3
  • 1
0

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.

Rami Atia
  • 47
  • 1
  • 3