我有一個巨大的文件,其內容是通過在不同的輸入文件上反覆運行可執行文件生成的。該文件的模式是這樣的: - 文件名後跟任意數量的文本行。當讀取輸入數據時出現錯誤,我必須拿起文件的名稱,我不確定最好的方法是什麼。另一個問題是,無論如何,短語中出現錯誤(最終擬合誤差是(某個數值))這個詞需要忽略。查找文件中的錯誤
C:\temptest\blahblah1
.. (arbitrary # of text lines)
Final fitting error : (some number) [I have to ignore this]
C:\temptest\blahblah2
.. (arbitrary # of text lines)
Error could not read data !** [I have to pick up blahblah2 and copy the file to another directory, but just logging the name would suffice]
在此先感謝!
你控制輸出?即你能改變它的格式嗎? – ulidtko 2011-02-11 23:48:50
我不控制文本行,但我可以在每個新文件之前插入一些特殊字符以標記正在處理的新文件。 – Illusionist 2011-02-11 23:51:25