Community

Get value from txt for export Answered

Good afternoon, I have a document which has a serial number. For example: 1102002. ABBYY extracts this nubmer well. However, for an export, I do not need this serial number. I have a txt file which contains key-value pairs of serial number and organization name which has this number. Example: 1102002 - "Global Invest". So, I need to get that "Global Invest" string from txt given that ABBYY recognized serial number. What is the way to do this? 

0

Comments

1 comment

  • Avatar
    Dias Duisembayev

    I was able to do this using C# script. I created an extra field in document definition and wrote this script:

     

    using System;

    using System.IO;

    using (StreamReader sr = new StreamReader(@"LOCATION"))

    {

        string s;

        while ((s = sr.ReadLine()) != null)

        {

            string[] lines = s.Split('|');

            if (Context.Field("SerialNumber").Text == lines[0]) {

            Context.Field("MyField").Value = lines[1];

            break;

            }

        }

     

    }

    0

Please sign in to leave a comment.