Hi guys,
I'm making a program which reads all files in a folder with test data, these files are known as logfiles. With each read logfile, I then need to extract only the lines which have the keyword in them... for example 'PASSED'.
Here lies the problem, when you open these logfiles with notpad, the entire file comes up on one line! When you open them with Wordpad they display as they should... So there's a special character. I've found the special character and for arguments sake let's call it '£'.
My code at present prints the line with the keyword on it - which unfortunately is the entire logfile :(
So what I need your help with is the part of the code which will read the entire file, looking for the keyword, when it finds the keyword, I want the script to put into a variable the following 'xxxx xxxxx xxxx xx xxxx PASSED xx xxxx xxx' from the code which would have '£' either side of this extracted text.
I've only been coding since monday and I think I'm doing a great job so far. I know I have soooo much to learn, but I'm really enjoying what I'm doing.
Thanks,
Matt
PS. The reason I have not included any code is that it's on another laptop and the only problem I have in the whole problem is listed above. Once I have the program working, I'll post the lot so you guys can help me improve it (if you want).