C#
Программа берет строки из файла data ( без расширения )
и создает data-unique
для работу нужен .NET
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace unique
{
class Program
{
static void Main(string[] args)
{
Encoding cp1251 = Encoding.GetEncoding(1251);
HashSet<string> hash = new HashSet</string><string>();
string line;
Console.Write("Read : ");
StreamReader file = new StreamReader(@"./data",cp1251);
while ((line = file.ReadLine()) != null)
{
hash.Add(line);
}
file.Close();
Console.Write("OKnWrite: ");
StreamWriter filew = new StreamWriter(@"./data-unique",false,cp1251);
foreach (String hval in hash)
{
filew.WriteLine(hval);
}
Console.Write("OKn");
}
}
}
</string>
php
< ?php file_put_contents(ok.txt , array_unique(file('файл.txt'))); ?>
Ставьте в php.ini много памяти и вперед пробовать.
Через консоль unix
cat source.txt | sort | uniq > result.txt
О сайте
Постоянные ссылки
При копировании ссылка на TeaM RSN обязательна!