COARRI and CODECO EDI Sample Code C#

Post author
Manish Goswami

I want to read CODECO and   COARRI EDI Files in c#. How to read any examples can you share?

Comments

2 comments

  • Comment author
    Admin

    Hello,

    You read any transaction file in exactly the same way as the rest. So for COARRI:

    var ediStream = File.OpenRead("C://yourcoarrifile.txt");

    List<IEdiItem> ediItems;
    using (var ediReader = new EdifactReader(ediStream, TemplateFactory.TrialTemplateFactory))
    ediItems = ediReader.ReadToEnd().ToList();

    var transactions = ediItems.OfType<TSCOARRI>();

    and for CODECO:

    var ediStream = File.OpenRead("C://yourcodecofile.txt");

    List<IEdiItem> ediItems;
    using (var ediReader = new EdifactReader(ediStream, TemplateFactory.TrialTemplateFactory))
    ediItems = ediReader.ReadToEnd().ToList();

    var transactions = ediItems.OfType<TSCODECO>();

    The template factory resolves the correct transaction. The trial only works with version D96A so when you test your files ensure that they are D96A version.

    0
  • Comment author
    Manish Goswami

    Thanks team for your prompt reply. Do i  need to Pay or it is free

    0

Please sign in to leave a comment.