Re: How to remove the letter “A” from all values in the data table

I’m sorry to post many times.
I want to delete the letter “A” from all values ​​in the data table.

I tried this method but failed with GENERATE DATATABLE ACTIVITY.
The cause seems to be because the data table value contains “,”.
Is there any other solution?

use the generate datable activity with “,” as the delimiter.

1 Like

@vishal.kp
The column has become one. What was wrong?

can you show the screenshot of your generate datatable inputs

May I know how the datatable looks like
Cheers @tera

1 Like


@vishal.kp
this

Enable CSV parsing and check once.

1 Like

@vishal.kp
有効にしましたが、良い結果が得られませんでした。

@Palaniyappan
It ’s hard to explain.
It lost regularity.

@tera
Have a Look on following Post as IT IS closed to your scenario. Instead of trim you Could Go with replace function

Removal of Trailing Spaces from Datatable - #11 by ppr

1 Like

@ppr
sorry.
I didn’t know much about LINQ, so I couldn’t understand how to implement LINQ.

@tera
No Problem as we all here will help you.

give a try on following, replace the datatavar with your variablename:

(From r In DataTableVar.AsEnumerable
Select ia = r.ItemArray.toList
Select ic = ia.ConvertAll(Function (e) e.ToString.Replace(“A”, “YourReplacementValue”).toArray()
Select dtCorrected.Rows.Add(ic)).CopyToDataTable()

the text replace approach is also a good option for solving the task. And for beginning doing the replacement with for each row and an inner for each iteration over the columns should work as well

Let us know if you do need more help. Feel free to share some sample data with us

2 Likes

@ppr
Sorry for the rudimentary question.
Is this entered in “Assign”?

@tera
Yes is used within an assign Activity. The Return is configured under the TO section and is of Datatype Datatable

The variable dtcorrected ist a Second Datatable. ITS recommended to initialized it before running the linq within an assign and using the Statement yourorigindatatablevar.clone

1 Like

キャプチャ
I don’t understand how to write Value.
An error “‘)’ is required” occurs.

@tera in this Part you are coding the replacement value from A. You want to remove A, so replace with “”, the empty value.

IT seems to me that the closing ) for the convertall function is Missing, so give a try on
The Part replace (“A”,“”))

キャプチャ
An error will occur if executed.

This is the error message.

Error is coming from a variable that is Not initalized. Is out_dt correctly initialized. IT was told to do it with the Clone statement