I want to filter duplicate data in a text file down to a single data and store it in a variable. how can i do
Best regards
I want to filter duplicate data in a text file down to a single data and store it in a variable. how can i do
Best regards
Try this
uniqueRows = fileText.Split(Environment.NewLine.ToCharArray()).Distinct().ToArray()
I hope it works!!
Hi @Famui_Yanisa ,
You could try Reading the Text file using Read Text File
activity, then based on the data shown, we can split the data based on the NewLine character and perform a Distinct operation to store only Unique data.
NewTextData = String.Join(Environment.NewLine,Split(TextData,Environment.NewLine).Distinct.ToArray)
Here, NewTextData
and TextData
are String variables, where TextData
is the Output from Read Text File
activity.
Assign filteredList = str_Text.Split(Environment.NewLine.ToCharArray())
Assign filteredList = filteredList.Distinct().ToArray()
Assign filteredText = String.Join(Environment.NewLine, filteredList)
Uploaded workflow file for reference with your given input
Sequence10.xaml (11.4 KB)
Hope it helps!!
Regards,
If you got the solution for your query. Please mark it as solution to close the thread and others also helped.
Regards,
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.