Clearing text file content

There are records in my notebook as follows. + and - cancel each other out. I want to remove these records from my list. I find it with find matching, then I count for each one and finally throw a list of arrays but I don’t know what to do next.
before

image

after

image

Hi,

Could you explain the question in more details what exactly you want to achieve?

Thanks

Hi @Mesut_Can

Please check the below wrokflow and attached text file:

Sequence2.xaml (15.0 KB)
Output:Input Data 2.txt (29 Bytes)
Input:Input Data 1.txt (158 Bytes)


Input:

Output:
image

OR ELSE YOU CAN ACHIEVE THE SAME THROUGH LINQ QUERIES ALSO

2024.xaml (21.6 KB)

Regards

Hi @Mesut_Can

This can be done without using the array if the data is stored in the Excel. In that case we can get the data in datatable & perform the linq operations on it. So the flow will look something like this.

Just replace the datatable name & Column name, This linq query will remove these records & will only keep the unique one.

YourDatatableName.AsEnumerable().GroupBy(Function(row) Math.Abs(Convert.ToInt32(row.Field(Of String)(“YourColumnName”)))).Where(Function(Group) Group.Count() = 1).SelectMany(Function(Group) Group).CopyToDataTable()

after this you can replace the updated datatable in the excel again using
image

Hope this helps :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.