Hi, I want to Trim an excel column tp remove all the leading or tailing spaces; for example
In the above table i have both number and Text data so i want to trim the extra spaces and arrange them equally i know how we do it in excel but i have no idea to how to automate this because i contains 3000+ rows so i cannot use loop. I want to get the column just like the “B Cell” (in screenshot) Any idea on this.
Hi,
I made below change in the code and it worked fine using single datatable
(From r In dtData.AsEnumerable
Let ra = r.ItemArray.Select(Function (e) If(isNothing(e), Nothing, e.toString.trim)).toArray()
Let dtData=dtData.Clone
Select dtData.Rows.Add(ra)).CopyToDataTable()