EDI Flat File parsing with C#?
Asked Answered
S

5

21

Initially I was thinking to use SSIS to parse an EDI file, however I've seen a few manual EDI parsers (field mapping), and would like to use automate this functionality in C#.

Example EDI File:

Example EDI File

Scylla answered 12/1, 2010 at 3:36 Comment(1)
Actually what I've recently found out is that it's the X12 820 4010 EDI format...Scylla
C
8

Have you seen http://www.codeproject.com/KB/XML/edix.aspx

Credence answered 22/2, 2010 at 21:29 Comment(0)
T
19

There is EDI.Net library which is opensource and supports all three known EDI formats (X12, EDIFact, Tradacoms). In your case for X12 you need to provide a custom implementation of the IEdiGrammar with the following presets.

public class EDI_X12Grammar : IEdiGrammar
{
...
}

var grammar = new EDI_X12Grammar() 
       {
            ComponentDataElementSeparator = new[] { '>' },
            DataElementSeparator = new[] { '*' },
            DecimalMark = null,
            ReleaseCharacter = null,
            Reserved = new char[0],
            SegmentTerminator = '~',
            ServiceStringAdviceTag = null,
            InterchangeHeaderTag = "ISA",
            FunctionalGroupHeaderTag = "GS",
            MessageHeaderTag = "ST",
            MessageTrailerTag = "SE",
            FunctionalGroupTrailerTag = "GE",
            InterchangeTrailerTag = "IEA",
        };

Disclaimer I wrote the library.

Takishatakken answered 2/8, 2016 at 16:39 Comment(5)
Hi. I want to use your library but it seems I need to use ASP.net Core? What framework version should I use please? ThanksHorodko
@Horodko it is build with the new dotnetcore sdk tooling but it is not limited to that. It is available in Full .Netframework 4.5 and later. Check the supported frameworks on nuget.org to see the list open the Dependencies section.Takishatakken
I think this is what I'm looking for but I can find no documentation on support for 271 doc anywhere.Wines
@Wines This is the serializer so you can find samples on how to build a transmision but may not have a transmission ready for the 271. You have to build the POCO models your self. Check the samples on the test projectTakishatakken
I tried the above mention library and it was great. I created blogged about here with some good examples: mylifeismymessage.net/edi-net-library-for-processing-edi-filesCothran
C
8

Have you seen http://www.codeproject.com/KB/XML/edix.aspx

Credence answered 22/2, 2010 at 21:29 Comment(0)
R
2

This is for X12 and worked pretty well for my uses:

http://x12parser.codeplex.com/

It's command line, and just outputs an XML file for your EDI file.

You could possibly adapt it for your purposes.

Recreate answered 4/4, 2012 at 15:39 Comment(0)
Q
1

I'm not familiar with the EDI file format, but would either of these help:

Quarrelsome answered 12/1, 2010 at 4:46 Comment(0)
S
0

I am not sure if you are open to commercial tools, but I am throwing this link out here just in case. It might help somebody. Disclaimer: I am not connected in any way to this provider.

FRAMEWORK EDI - EDI Tools for Programmer (Commercial Framework) - Find it here: http://www.edidev.com/

Scavenger answered 26/3, 2010 at 21:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.