Remove apostrophe from a column

Hi!

Do you know when, in a excel column, there’s an apostrophe “invisible” changing numbers into text? Can I remove this apostrophe?

I want to convert a column into number, I’ve already tried a for each row activity but didn’ work!

row("DT").ToString.Replace(" ' ","")

1 Like

MyIntegerVariable = Convert.ToInt32(row(“DT”))

Even though it has as a apostrophe when read range is used that won’t come and only string will be returned
But are you getting along with that apostrophe

Fine
If so we can use regular expression like this in for each row loop as you are doing now
row(“yourcolumnname”) = System.Text.RegilarExpressions.Regex.Match(row(“yourcolumnname”).ToString,”\d+”).ToString

This will give only numbers from that row

Cheers @Giulia_G

1 Like

@Palaniyappan

I’m using an assign inside the For Each Row, and getting this message

“‘Match’ is a type in ‘Regular Expressions’ and cannot be used like an expression”

1 Like

Kindly have a view on the previous comment
Updated it with the expression

row(“yourcolumnname”) = System.Text.RegilarExpressions.Regex.Match(row(“yourcolumnname”).ToString,”\d+”).ToString

Cheers @Giulia_G

@Palaniyappan One last question, I’m sure you know this one… Do you know how can I remove zeros from a column? It’s always on the left side

Thanks for helping me so much!

1 Like

Yes we can same like this
row(“yourcolumnname”) = row(“yourcolumnname “).ToString.TrimStart(“0”)

Cheers @Giulia_G