i have a problem concerning a special character in a field I scrape from a webpage.
The field looks like that:
I only want the number, so I replace the other characters:
Unfortunately, I can
t assign the processed number to an INT32-Field, because the process says that its in the wrong format. After copying the error message in a word, I saw that there is a special character in between:
I want to replace the °, but if I copy the sign from word into my process, I only get an empty space. Also if I want to replace the ° with the character on my keyboard it doesn`t work.
Any suggestions? Im grateful for your help!
Can you share the Input and output string
You can achieve via Regex expression
System.Text.RegularExpressions.Regex.Replace(Inputstring, “[^\w\-]”, “”).ToString
About the kilometers… also have a look on Regex like
then you can post process the string further
Thx, but doesn`t work. I also used the # to see if it puts it in my number, unfortunately the result is still the same as before.
Thx, but doesn`t work.
as also shown in the screenshot was the usage of ASC method.
We can use this method, when passing the particular unknown char to it by using the position index of it within the string.
However we would recommend
start analysis on the webpage and check for any entities
check the result when grabbed from there
do analysis as mentioned above
avoid too much corrections in one go
Currently we also cannot match 87°097 screenshot to your reported 182 800 km case. Maybe you can elaborate on it
You are right Peter, thank you for your help! I will have a look on your suggestions!
Unfortunately the REGEX Expression doesn`t help. My Expression in the Assign activity KilometersRegex:
System.Text.RegularExpressions.Regex.Replace(KilometersReady, “[^\w\-]”, “”).ToString
The input from “KilometersReady” :
“message”: “87 097 km”,
The output after Kilometers Regex:
“message”: “87 097 km”,
Can you share the Input and Output
better input output samples would help us. Also have a look on this
last line is about to extract a block as short as possible and extract from this only the digits
@FAB We can ignore these type of characters and get only numbers separated by it and finally concat the entire value
This way in future if you get any character other than this, that can be simply handled with the above logic
Please find the workflow attached
Regex.zip (2.3 KB)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.