Delete string in data table - if

Hi @wwls ,

In the Datatable approach, assuming that you have already read the data as a Datatable, we will be able to filter the required rows that contains the New Line character in the below way :

DT = DT.AsEnumerable.Where(Function(x)Regex.IsMatch(x(0).ToString,"\n")).CopyToDataTable

Here, DT is the input datatable, FilteredDT is a new Datatable and 0 index is used to mark the first column in the datatable.

The above expression would result in an error if there are no rows filtered that matches the condition and hence you could follow the post below on handling that error :