我需要能夠從現有文本文件中提取數據。文本文件的結構看起來像這樣...在現有文本文件中查找並提取文本
this line contains a type of header and always starts at column 1
this line contains other data and is always tabbed in
this line contains other data and is always tabbed in
this line contains other data and is always tabbed in
this line contains other data and is always tabbed in
this line contains other data and is always tabbed in
this line contains other data and is always tabbed in
this line contains a type of header and always starts at column 1
this line contains other data and is always tabbed in
this line contains other data and is always tabbed in
this line contains other data and is always tabbed in
this line contains a type of header and always starts at column 1
this line contains other data and is always tabbed in
this line contains other data and is always tabbed in
this line contains other data and is always tabbed in
this line contains other data and is always tabbed in
this line contains a type of header and always starts at column 1
this line contains other data and is always tabbed in
this line contains other data and is always tabbed in
正如您所看到的,文本文件按部分排列。總是有一個標題行,隨後是隨機數的其他數據行,並且段之間總是有空行。不幸的是,標題部分的命名方案或其他數據行中包含的數據沒有韻或理由......只有上述結構有點一致。我需要搜索的數據位於其他數據行之一中,僅位於其中一個部分,可以位於文本文件的任何位置。我可以使用FIND命令來查找我需要查找的文本,但是一旦我這樣做了,我需要能夠將整個部分提取到新的文本文件中。我無法弄清楚如何在第一個前面的空行上多行,然後下行到下一行空行,並提取它們之間的所有內容。那有意義嗎?不幸的是,VBScript根本就不是這個應用程序的一個選項,或者它早就結束了。有任何想法嗎?感謝名單。
這工作非常完美!謝謝!!! – 2012-01-17 21:38:44
@StevenSinclair - 如果這樣做,那麼不要忘記點擊複選標記將其選爲解決方案。如果你認爲這個答案是有用的,那麼你也可以投票答案(如果你這麼傾向)。 – dbenham 2012-01-17 21:49:53