How to keep 0 before number in excel using uipath

Hi Team,

I have facing issue of sheet1 excel copy to sheet2 that values of before 0 removed how to keep in 0 value in both sheet1 and sheet2.

How to avoid long space in particular column cell values.

Please help anyone on this

Sheet 1–Input:

Sheet 2 --Error
image

Expected Result:
image

Regards,
Raja G

If it is 3 digit values, use below expression

"YourString.padleft(3,cchar("0"))

Otherwise try this, while reading excel, check the preserve format option to be enabled

Hi @Raja.G

Can you share the sample input excel file

Hi @Gokul001 ,

Please refer the sample excel below
Book1.xlsx (11.8 KB)

Hi @Raja.G

Check out the XAML file

KeepZeroExcel.xaml (5.2 KB)

image

Output

Regards
Gokul

Hi @Gokul001 ,

Before 0 maintain worked but I want remove long space in particular column row value

Please help me on this

Hi @Raja.G

Enable Show Modern in the filter

image

Check out this Workflow

KeepZeroExcel.xaml (9.6 KB)

image

Output

Regards
Gokul

1 Like

Hi @Raja.G ,

In the Input data provided, we could also see that there maybe a Junk data at the beginning (Name column) which also you would want to remove. But since it is text, unless it follows a certain format we cannot remove it or if tried we may also lose the required data.

If you do think there is particular pattern to these Junk data that you want to remove then we should be able to use regex to do the operation else it would not be a proper data output.

Let us know your thoughts on this.

1 Like

For keeping the 0 at the start, edit the values of column C and add a Single qoute (') before the 0. This will tell excel to treat this value as String and not as a Number.

HI @Raja.G

Have you got the Output that you required

If yes, Kindly close this topic by mark as solved. It will help for other too.

Regards
Gokul

I want to remove before and after long space in cell in particular column(“Name”)

Input:
image

Output:

image

Hi @Raja.G to remove the long space before and after text u can use “trim” in string format but for the unwanted junk values we should know the format to use regex.

@Raja.G ,

If this is the data, Then could you check the below workflow :
Excel_Remove_LongSpaceInRows.zip (11.4 KB)

Also, I do think that you are missing 000’s in the input as well ?

HI @Raja.G

Check out this XAML file

KeepZeroExcel.xaml (10.9 KB)

image

Output

Regards
Gokul

1 Like

Put a single quote before the value. This tells Excel to format the number as text.

Hi @supermanPunch @Gokul001 ,

Thanks guys working fine

1 Like

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