ppr
(Peter Preuss)
July 3, 2020, 7:59am
4
@DaveF
have a look on following demo, showcasing removing, trimming values:TrimRemove_AllCellsAllRows.xaml (9.0 KB)
with a change of the replace arguments the NA, - can be changed with the approach. As replace is chainable we can work like this. yourString.replace(“NA” …replace(“-”…
also have a look here:
@Rachel7
this is maybe a too quick shot as it replace any space in any column to NA and returns a datatable.
But you can give a try
(From r In dtData.AsEnumerable
Select ia = r.ItemArray.toList
Select ic = ia.ConvertAll(Function (e) e.ToString.Trim.Replace(" ","NA")).toArray()
Select dtCorrected.Rows.Add(ic)).CopyToDataTable()
NEW VERSION, simplified:
(From r In dtData.AsEnumerable
let ra = r.ItemArray.Select(Function (x) x.ToString.Trim.Replace(" ","NA")).toArray()
Select dtCorrected.Rows.…