How can remove space between number

Space
Main Sheet graph.xlsx (9.5 KB)
Dears pleas any one have idea how i can remove the space between number as shown in snap
i want check all the cells and if there is space i want removed it

thanks

read cell then use replace " " with “”
use excel appl scope inside it For each row then use assign activity in which assign
row(column index)=row(column index).tostring.replace(" “,”")

2 Likes

Suppose you are having a variable , strValue
Try this
strValue= strValue.replace(" “,”")

Hope it will help!!

could you please check my xaml because it’s not working

also with Read Cell get this error

Hi @Mohamed_Abbas ,

You can use row(0)= row(0).ToString.Replace(" ",string.Empty) in the assignment activity.

Warm regards,
Nimin

Hi @Mohamed_Abbas,

You are getting the above error because, row(1) doesn’t have any contents. From your screenshot, its look like you are using read cell activity instead of read range activity. Please use ‘Read Range’ activity with your desired range.

Warm regards,
Nimin

thanks dear but still not working o modified as you say

Hi @Mohamed_Abbas,

Are you sure you are writing the modified datatable ‘DT1’ back to the excel file?
Please use a write line activity with text row(0).ToString after you removing the whitespace from row(0) to verify it.

Regards,
Nimin

Hi @nimin

like this

Hi @Mohamed_Abbas,

Yes. Please check your output panel and verify your output.

Regards,
Nimin

1 Like

@Mohamed_Abbas
If you are trying to use String.Replace(" “,”"), this will remove only the first occurence of the " “. If there are more than one occurences like 12 21. 98, post replace, value will be 1221. 98
The efficient way to replace all space is by using regular expression.
newvalue = Regex.Replace(inputString, @”\s+", “”)

2 Likes

Hi Abbas,

You can put one check ,like

if string.isnullorempty(strValue) ,
if boolean is false than implement replacement of space with nothing.

Hello Hope you got your solution as @Madhavi @nimin suggest you
if still having prob then pls refer below wf for your excel file
Test_Remove.zip (17.4 KB)

Pls make changes as per your need !

2 Likes

Thanks Dear
issue already solved as @nimin @Madhavi say

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.