
01.09.2009, 18:47
|
|
Постоянный
Регистрация: 15.06.2008
Сообщений: 941
С нами:
9423746
Репутация:
2399
|
|
delete_del.pl <имя файла>
на выходе получим: out_<имя файла>
PHP код:
#!/usr/bin/perl -w
#use: .pl input.txt
$inputF = shift;
$ouputF = 'out_'.$inputF;
open (F , "<$inputF");
@input = <F>;
chomp (@input);
close F;
%out = ();
@input = grep(!$out{$_}++, @input);
open (F , ">>$ouputF");
print F join("\n",@input);
close F;
|
|
|