Windows命令行排序
Windows Command line sort
我有一个需求,我想读取一个文件内容,对内容进行排序,然后将排序后的内容写入同一个文件。喜欢整理文件。
我对Windows命令知之甚少。我知道 Windows 排序命令会有所帮助,但我不知道写入同一个文件。
需要专家的帮助。
通过在控制台中输入 sort /?
查看 sort.exe 的帮助:
/O[UTPUT] [drive:][pathname]
The file where the sorted input is to be stored.
If not specified, the data is written to standard output.
Specifying an output file is faster than redirecting
standard output to a file.
sort sort.txt /o sort.txt
或者如果你想将结果附加到另一个文件
sort sort.txt >> c:\temp\cominedresult.txt
我有一个需求,我想读取一个文件内容,对内容进行排序,然后将排序后的内容写入同一个文件。喜欢整理文件。
我对Windows命令知之甚少。我知道 Windows 排序命令会有所帮助,但我不知道写入同一个文件。
需要专家的帮助。
通过在控制台中输入 sort /?
查看 sort.exe 的帮助:
/O[UTPUT] [drive:][pathname]
The file where the sorted input is to be stored. If not specified, the data is written to standard output. Specifying an output file is faster than redirecting standard output to a file.
sort sort.txt /o sort.txt
或者如果你想将结果附加到另一个文件
sort sort.txt >> c:\temp\cominedresult.txt