I need to be able to extract data from within an existing text file. The structure of the text file looks something like this...
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
As you can see, the text file is arranged in sections. There is always a single header line, followed by a random number of other data lines, and there is always a blank line between sections. Unfortunately, there is no rhyme or reason to the naming scheme of the header sections or the data contained within the other data lines...only the aforementioned structure is somewhat consistent. The data I need to search for is located within one of the other data lines, in only one of the sections, which could be located anywhere within the text file. I can use the FIND command to locate the text I need to find, but once I do that, I need to be able to extract the entire section to a new text file. I can't figure out how to go up however many lines to the first preceeding blank line, then go down to the next following blank line, and extract everything in between. Does that make sense? Unfortunately, VBScript is simply not an option for this application or it would've been over and done with long ago. Any ideas? Thanx.