Removing specific character from DT column list

Hello

How would you write the expression for removing a character from a list under a column for e.g.

Column1
123,4
123,5
123,6

and removing the ,

Can I use the assign activity here?

Hi
The expression be like this
dt = dt.AsEnumerable().Orderby(Function(a) a.Field(of string)(“Column1”).ToString.Replace(“,”,””) ).CopyToDatatable()

Cheers @Cormac

1 Like

Hi @Cormac

You can use for each row then assign var =row(“column name”).testing
Then use other assign activity then create new var = var.replace(",","")

If you find it useful mark it as solution and close the thread

Cool,
Regards,
Gulshiyaa

Hi Palan

I am getting the following error

Also - doing this as well from the last time you help me. Would the error be because I am using the same DT?

Is this assigned to any Boolean variable or argument
Or
May I know where it is used
It would be in ASSIGN activity
Cheers @Cormac

1 Like

dont copy and past from here, remove the quotes and type them again :slight_smile:

1 Like

It is just used as a variable within one sequence. I am using it as an ASSIGN in the first and second screen shot. Would the problem be that I am using ASSIGN twice?

image

1 Like

Get the cursor to that blue mark in that activity so that we can know what is the error
Cheers @Cormac

1 Like

This is the error - TrackerDT is a variable with a variable type of DataTable

Hmm
If possible kindly share your xaml pls
Cheers @Cormac

1 Like

Main.xaml (6.8 KB)

1 Like

Thats the individual sequence

@Cormac
You got this error as the where statement is expecting a true/false from lambda function. However @bcorrea gave you already an answer or will help you

1 Like

yah
i made changes in the expression with first comment, where method can be used only when we set a condition or an assignment
so the expression be like this
dt = dt.AsEnumerable().OrderBy(Function(a) a.Field(of string)(“Column1”).ToString.Replace(“,”,””) ).CopyToDatatable()

Cheers @Cormac

1 Like

Thanks for you help!

I think there is a problem with the .CopyToDatatable however.

I am getting the following error when I type it into assign

‘CopytoDataTable’ is not a member of 'Systems.Collections.Generic.IEnumerable(Of System.Linq.IGrouping(Of String, System.Data.DataRow))

1 Like