C
Carl Wilson
I usually include code that I've written so far for a project that I have
problems with but it isn't working the way I wrote it so I want to pick your
brains.
I have a log file from a system that is over 3k pages long (depends on the
date range I ask for!) I have written code that cleans all the misc. crap
that is not important to me, now I need to write a code that will select the
text from the beginning of the file, until a certain string of characters is
found, let's say "----" this is an indication that a single record in the
file is complete. (selecting the stop string would be okay too) Then I want
the code to check to see if it finds a condition in the selected text, lets
say a particular word like "Howdy". If the file finds that condition I want
it to copy that file to another file.
Because of the size of the file I was trying to write the code to do like I
said except that if the code wasn't found, delete the selected text, start
again. Then the only thing left in the log file would be the records I
wanted. Problem, was it started looping the first time it found the code
since I wrote it to start at the beginning of the file. So either way will
work if you can tell me how to tell the dumb code to start the last place it
stopped. Extracting to a different file would be better so I don't destroy
the orginal log file. As I said, the data I am searching through is pretty
much unpredictable except for the end record string, that's why I need to be
able to search the selected text for the condition.
This would be extremly helpful. Thanks.
Willy
problems with but it isn't working the way I wrote it so I want to pick your
brains.
I have a log file from a system that is over 3k pages long (depends on the
date range I ask for!) I have written code that cleans all the misc. crap
that is not important to me, now I need to write a code that will select the
text from the beginning of the file, until a certain string of characters is
found, let's say "----" this is an indication that a single record in the
file is complete. (selecting the stop string would be okay too) Then I want
the code to check to see if it finds a condition in the selected text, lets
say a particular word like "Howdy". If the file finds that condition I want
it to copy that file to another file.
Because of the size of the file I was trying to write the code to do like I
said except that if the code wasn't found, delete the selected text, start
again. Then the only thing left in the log file would be the records I
wanted. Problem, was it started looping the first time it found the code
since I wrote it to start at the beginning of the file. So either way will
work if you can tell me how to tell the dumb code to start the last place it
stopped. Extracting to a different file would be better so I don't destroy
the orginal log file. As I said, the data I am searching through is pretty
much unpredictable except for the end record string, that's why I need to be
able to search the selected text for the condition.
This would be extremly helpful. Thanks.
Willy