Hi Guys
Firstly, thank you for your replies.
Secondly
Quote:
Originally Posted by
fubaya
I'm not sure I follow, is the "no" a typo and supposed to be a "yes"?
The "No" was not a typo.
Here is a similar example of the file layout (The original has more a lot more data columns in it):-
LineNo Date Time Result Yes/No Data 1 Data 2 Data 3
1 08/03/2010 12:00:01 No Blah Blah Blah Blah
2 08/03/2010 13:00:01 No Blah Blah Blah Blah
3 08/03/2010 14:00:01 No Blah Blah Blah Blah
4 08/03/2010 15:00:01 No Blah Blah Blah Blah
5 08/03/2010 16:00:01 No Blah Blah Blah Blah
6 08/03/2010 17:00:01 No Blah Blah Blah Blah
7 08/03/2010 18:00:01 No Blah Blah Blah Blah
8 08/03/2010 19:00:01 No Blah Blah Blah Blah
9 08/03/2010 20:00:01 No Blah Blah Blah Blah
10 08/03/2010 21:00:01 No Blah Blah Blah Blah
11 09/03/2010 22:00:01 No Blah Blah Blah Blah
12 09/03/2010 23:00:01 No Blah Blah Blah Blah
13 09/03/2010 00:00:01 Yes Blah Blah Blah Blah
14 09/03/2010 01:00:01 Yes Blah Blah Blah Blah
15 09/03/2010 02:00:01 Yes Blah Blah Blah Blah
16 09/03/2010 03:00:01 Yes Blah Blah Blah Blah
17 09/03/2010 04:00:01 Yes Blah Blah Blah Blah
18 09/03/2010 05:00:01 Yes Blah Blah Blah Blah
19 09/03/2010 06:00:01 Yes Blah Blah Blah Blah
20 09/03/2010 07:00:01 Yes Blah Blah Blah Blah
21 10/03/2010 08:00:01 Yes Blah Blah Blah Blah
22 10/03/2010 09:00:01 Yes Blah Blah Blah Blah
23 10/03/2010 10:00:01 No Blah Blah Blah Blah
24 10/03/2010 11:00:01 No Blah Blah Blah Blah
25 10/03/2010 12:00:01 No Blah Blah Blah Blah
26 10/03/2010 13:00:01 No Blah Blah Blah Blah
27 10/03/2010 14:00:01 No Blah Blah Blah Blah
28 10/03/2010 15:00:01 No Blah Blah Blah Blah
29 10/03/2010 16:00:01 No Blah Blah Blah Blah
30 10/03/2010 17:00:01 No Blah Blah Blah Blah
31 11/03/2010 18:00:01 No Blah Blah Blah Blah
32 11/03/2010 19:00:01 No Blah Blah Blah Blah
33 11/03/2010 20:00:01 No Blah Blah Blah Blah
34 11/03/2010 21:00:01 No Blah Blah Blah Blah
35 11/03/2010 22:00:01 Yes Blah Blah Blah Blah
36 11/03/2010 23:00:01 Yes Blah Blah Blah Blah
37 11/03/2010 00:00:01 Yes Blah Blah Blah Blah
38 11/03/2010 01:00:01 Yes Blah Blah Blah Blah
39 11/03/2010 02:00:01 Yes Blah Blah Blah Blah
40 11/03/2010 03:00:01 Yes Blah Blah Blah Blah
41 12/03/2010 04:00:01 Yes Blah Blah Blah Blah
42 12/03/2010 05:00:01 Yes Blah Blah Blah Blah
43 12/03/2010 06:00:01 Yes Blah Blah Blah Blah
44 12/03/2010 07:00:01 Yes Blah Blah Blah Blah
45 12/03/2010 08:00:01 No Blah Blah Blah Blah
46 12/03/2010 09:00:01 No Blah Blah Blah Blah
47 12/03/2010 10:00:01 No Blah Blah Blah Blah
48 12/03/2010 11:00:01 No Blah Blah Blah Blah
49 12/03/2010 12:00:01 No Blah Blah Blah Blah
50 12/03/2010 13:00:01 No Blah Blah Blah Blah
51 13/03/2010 14:00:01 No Blah Blah Blah Blah
52 13/03/2010 15:00:01 No Blah Blah Blah Blah
53 13/03/2010 16:00:01 No Blah Blah Blah Blah
54 13/03/2010 17:00:01 Yes Blah Blah Blah Blah
55 13/03/2010 18:00:01 Yes Blah Blah Blah Blah
56 13/03/2010 19:00:01 Yes Blah Blah Blah Blah
57 13/03/2010 20:00:01 Yes Blah Blah Blah Blah
58 13/03/2010 21:00:01 No Blah Blah Blah Blah
59 13/03/2010 22:00:01 No Blah Blah Blah Blah
60 14/03/2010 23:00:01 No Blah Blah Blah Blah
Sorry, I know that the headings don't line up. They will when I complete the script and apply column formatting.
As I said the file I am working with is a great deal larger than this example.
I am hoping that the script will be able to search for the first instance of Yes, then I need to be able to output that line and then 50 lines before and after this line.
Then the script should continue and find the next instance of "Yes" and repeat the procedure.
I hope this clarifies things a little.
Cheers
abcd69