有没有办法使用type
命令根据文件名来连接多个日志.txt文件?连接文件根据文件名
例如,如果文件以System。[Timestamp]。*开头,那么我希望所有以System开头的文件的内容合并到一个主文件中,并且如果文件以其他内容开始,那么内容应该附加到另一个主日志文件。这可能通过命令行或通过使用批处理文件?
我想到了什么,但我不知道究竟如何处理这一点,并检查文件名:
for %x in (*.txt) do (//loop through whole directory
//here i think there should be a check if a file starts System.*
//and if so then type fileName.txt > SystemMasterLog.txt
)
谢谢您的时间。
谢谢! @foxidrive – AlexFaux
我稍微修改它以包含以'system'开头的所有'.txt'文件并重命名临时文件。 – foxidrive