I extracted Humidity of a place from web as 91% . I have used str_Humidity.Substring(0,str_Humidity.Length-1) to eliminate %. It worked but when I try to write it in excel it is storing as 9100% please help.
saved as below into the excel:
I extracted Humidity of a place from web as 91% . I have used str_Humidity.Substring(0,str_Humidity.Length-1) to eliminate %. It worked but when I try to write it in excel it is storing as 9100% please help.
saved as below into the excel:
As long as your string is extracted as ‘91%’ you can simply do str_Humidity.Replace("%", "")
If that still outputs as shown in your picture, make sure the formatting on that cell is correct in the excel file.
I received this result using the above:
you can try this regular expression
System.Text.RegularExpressions.Regex.Match(strinput,“[0-9]+”).Value
it will match only numbers
you can try this way its working all
in the write cell you mention like this conditions
str_Humidity.Replace(“%”,“”)
System.Text.RegularExpressions.Regex.Match(str_Humidity,“[0-9]+”).Value
3.System.Text.RegularExpressions.Regex.Replace(str_Humidity,“%”,“”)
write cell condition like this
for reference you can see the output :-
Initially I tried this way as well, but still it prints the same way into the excel.
Later got to know that, that was an excel issue, I formatted the cell to text and it worked.
anyway Thank you very much !
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.