Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?
Save up to 50% on our desktop apps during our Year End Sale!Save up to 50% on our desktop apps during our Year End Sale, including DisplayFusion, ClipboardFusion, FileSeek, LogFusion, TrayStatus, and VoiceBot!Save up to 50% on our desktop apps during our Year End Sale!

De-Duplicator

Description
This Macro removes duplicate lines and creates a comma separated list of the remaining lines.
Language
C#.net
Minimum Version
Created By
Omar35708
Contributors
-
Date Created
Jul 31, 2024
Date Last Modified
Jul 31, 2024

Macro Code

using System;
using System.IO;
using System.Collections.Generic;
public static class ClipboardFusionHelper
{
	public static string ProcessText(string text)
	{
		List<string> oItems = new List<String>();
		StringReader sr = new StringReader(text);
		string line;
		line = sr.ReadLine();
		while (line != null)
		{
			string[] parts = line.Split(',');
			foreach (string strPart in parts)
			{
				string strNewPart = strPart.Trim();
				if (!oItems.Contains(strNewPart))
				{
					oItems.Add(strNewPart);
				}
			}
			line = sr.ReadLine();
		}
		// Removed the sorting step: oItems.Sort();
		return String.Join("\n", oItems.ToArray());
	}
}