【发布时间】:2017-09-27 09:30:56
【问题描述】:
我正在使用下面的代码将文件夹中的所有文本文件合并为一个简单文件,问题是代码不会换行并最终混合单词。
copy *.txt Combined.txt
Echo.
Echo Done!
Echo.
pause
当它结束时,他会保持这样:
abcblue
123abcyellow
123abc
当我期望它会变成这样时:
ABC
blue
123
abc
yellow
123
abc
怎么了?
注意:我在互联网上找到了这个 sn-p 的代码,它看起来像主题:
FOR %f IN (*.txt) DO type %f >> Combined.txt & echo. >> Combined.txt
在这种情况下:
type file1.txt >> newfile.txt
echo. >> newfile.txt
type file2.txt >> newfile.txt
echo. >> newfile.txt
type file3.txt >> newfile.txt
echo. >> newfile.txt
但我需要它自动抓取所有文本文件并合并。
【问题讨论】:
标签: batch-file text merge copy line-breaks