Total Commander Forum Index Total Commander
Форум поддержки пользователей Total Commander
Сайты: Все о Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Single Post  Topic: Удаление одинаковых названий файлов в документе 
Author Message
Bishop



PostPosted: Wed Jul 16, 2008 12:30    Post subject: Reply with quote

maxeon
В PowerShell это можно сделать командой:
Code:
Get-Content 1.txt | Sort-Object -Unique | Set-Content 1.txt

Где 1.txt — твой файл с именами.

Или вот такой батник:
Code:
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
IF -%1==- GOTO :EOF
IF NOT EXIST %1 GOTO :EOF
SET tmpfile=~~~.txt
SORT %1 /O %tmpfile%
FOR /f %%f IN (%tmpfile%) DO ((IF NOT !asdfg!==%%f ECHO %%f) & SET asdfg=%%f)
SET asdfg=
DEL %tmpfile%
SET tmpfile=
ENDLOCAL

Сохранить текст в, например, 1.cmd.
Запустить так: 1.cmd 1.txt > 2.txt
В 2.txt будет результат — отсортированный список без дубликатов.


Last edited by Bishop on Wed Jul 16, 2008 13:22; edited 1 time in total
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group