Community

Script to remove whitespace and anything after

Hi!

New to scripting in Abbyy...and hoping to get some help on a script to remove white space and also remove some text from my string (anything after / including the /)

I have a table named PoDetails and a column named PartNumberDescription - this is the row where the script should apply but struggling to get this to work

Example string in row: A6695 650 20 NDF / 0

Desired outcome: A669565020NDF

Any ideas anyone?

Thanks!!

0

Comments

3 comments

  • Avatar
    Ekaterina

    Hello,

    We recommend to use the autocorrection script for your purpose https://help.abbyy.com/en-us/flexicapture/12/developer/script_conversion

    0
  • Avatar
    Hamdi123

    Hello,

    Try this:

     

    string S = "A6695 650 20 NDF / 0" ; 

    string newstring = S.Replace(" " , "").Replace(/, "");

    Output => newstring = "A669565020NDF0"

     

    Regards,

     

    0
  • Avatar
    Rahul Kapoor

    Hey,

    You below code to get your desired output:

    string example = "A6695 650 20 NDF / 0" ;
    example = example.Replace(" " , "");
    int index = example.IndexOf("/");
    example = example.Substring(0, index);

      output = A669565020NDF

    0

Please sign in to leave a comment.