Search code examples
htmlexcelautomationwhitespaceautomationanywhere

How to get rid of   in AA


I am reading data (combination of letters and numbers) from an excel sheet and put it into a text field in target application, where the input should yield a unique item from a database.

However there (sometimes) is a whitespace behind the data in the excel cell, which results in a "no data found" when this whitespace is entered into the search field in target application. The whitespace does not seem to be a space though, since i am unable to trim that whitespace AA-internally. I guess it is a   (or some similar html special character).

edit: confirmed to be a   by now.

Q: How can i get rid of such characters AA internally?

Tried: Neither (a) Trim, (b) Replace " " ->"", nor (c) Replace " "->"" work.

Workaround: I am currently checking for the length of the data provided: if its longer than 10 chars i only take the leftmost 10 chars. This works here, since its a business rule for the data i am working with, but i am still interested in an original solution, since there may be upcoming cases, where no business rule will help me out.

AA Version: 11.3.1

Thankful for input...


Solution

  • Okay, since it's non-breaking spaces character, you can replace it using Regex in replace command.

    Find: \u00a0
    Options: Regular Expression.