将文件中的数字按从小到大的顺序排列

主要利用了 Findstr+Sort .

:: lxmxn @ cn-dos.net
:: 15:58 2007-7-28
:: sort numbers in a file
@echo off&Setlocal EnableDelayedExpansion
set sorts=.
>nul copy nul output.txt
For /L %%a in (1,1,10) do (
    findstr "^^!sorts!$" input.txt|sort >> output.txt
    set sorts=!sorts!.
    rem echo !sorts!
)
start notepad output.txt
This entry was posted in Bat/Vbs/Html/... Script. Bookmark the permalink.

发表评论

您的电子邮箱不会被公开。 标记为 * 的区域必须填写

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>