Add 0 to Column in Excel

Hi,

I have this column in excel and I want to add a “0” in front of all values in the column <ASOS_PO>.

So <500005215980> becomes <0500005215980>.

Can someone help please?

Thanks!

1 Like

@Yudhisteer_Chintaram1

"0" + colValue.ToString

4 Likes

Hi @kumar.varun2 ,

It woked but I have one more constraint. Can I add “0” only to values where it does NOT start with <50000>.

That is ignore all values starting with “50000”. Thanks!

Hi @Yudhisteer_Chintaram1

You can use if condition in this case yourcolumnvalue.toString.contains(“5000”)

else part you can have the string concatenation with the column values.

Regards

I tried that. It works but contains check if 50000 exists anywhere in the value as I want to check if it STARTS with 50000.

@Yudhisteer_Chintaram1 - Please check this…

“50000521978”.Substring(0,6).Contains(“50000”)
true

or we can use Regex.ismatch to check the value at the start…

image

3 Likes

@prasath17

Like that:

It is not working :frowning:

The whole process

@Yudhisteer_Chintaram1 - is it possible to share the sample sheet with just one column??

Hi @Yudhisteer_Chintaram1 ,

Try like this.

image

1 Like

No no it works. Just a minor typo :slight_smile:

Thanks!

1 Like

Hi @Yudhisteer_Chintaram1
Sample workflow and excel that is use full for you.
Book1.xlsx (8.9 KB)

Main.xaml (9.1 KB)

Please mark it as solved.

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