KAPOW

Would you like to react to this message? Create an account in a few clicks or log in to continue.
KAPOW

Welcome to the Kapow forum. Here you can get help, use your skills to help others and enjoy hanging out in the company of other Kapow Robot Developers.


2 posters

    Number extracts with space how to remove?

    avatar
    andobe


    Posts : 14
    Points : 2102
    Join date : 2019-03-22

    Number extracts with space how to remove?  Empty Number extracts with space how to remove?

    Post by andobe Mon Apr 01, 2019 1:44 pm

    Hello! 

    I am extacting a number from a ERP system where i use ISA tree mode. But for some uknown reason to me the number is extracted and a space is added. So lets say i am extracting number 45,67 but after extraction it is save to varable as 45, 67, so a space is added after the comma. Does anybody know a way to fix this? This happens only in some numbers and not all.
    batman
    batman


    Posts : 47
    Points : 2124
    Join date : 2019-03-19

    Number extracts with space how to remove?  Empty Re: Number extracts with space how to remove?

    Post by batman Mon Apr 01, 2019 10:26 pm

    Hi,

    You should be able to achieve this fairly easily using the inbuilt replaceAll function in DA. Syntax -> replaceAll(TextToFormat, TextToReplace, ReplacementText)
    Once you have extracted and stored the value in a variable, use the Assign step to convert the text string with the replaceAll function.

    However, the reason you are getting extra spaces is that ISA uses on screen OCR to read the text values from the desktop. OCR is highly susceptible to errors so shouldn't really be relied on for extracting values unless it's a last resort, there's a good chance the next value you extract will have a different type of misread so all of these possibilities will need to be handled in your workflow.

    Depending on the ERP there may be some alternative approaches. If it's SAP, then enabling SAP Scripting GUI will allow direct interaction with the SAP client, for Oracle EBS or other Java applications the Java Bridge is recommended. If none of these are applicable then you should check first if you can copy the value to the clipboard rather than extracting the text returned by ISA (use ISA or keystrokes to get the field focus first), this way you're not reliant on OCR results

      Current date/time is Fri Nov 15, 2024 2:04 pm