有沒有辦法使用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