From: Dr. David Kirkby on
Chess games are stored in a standard format call 'pgn'. Two games,
plus the start of a 3rd game are below.


[Event "ICC 2 12 (blitz)"]
[Site "Internet Chess Club INT"]
[Date "2004.01.24"]
[Round "-"]
[White "g8wrb"]
[Black "ininias"]
[Result "0-1"]
[WhiteElo "1085"]
[BlackElo "1347"]
[ECO "C41"]
[NIC "KP.10"]
[Opening "Philidor's defense"]
[TimeControl "120+12"]
[Time "14:27:52"]
[ICCResult "White resigns"]

1. e4 e5 2. Nf3 d6 3. Bb5+ Bd7 4. Bxd7+ Qxd7 5. Nc3 a6 6. Nd5 h6 7. d3
c6
8. Ne3 Be7 9. Bd2 Nf6 10. Qe2 b5 11. h3 c5 12. Bc3 Nc6 13. Nd5 b4 14.
Nb6
Qb7 15. Nxa8 bxc3 16. bxc3 Qxa8 17. O-O Bd8 18. Qe3 O-O 19. Rab1 Ba5
20. d4
cxd4 21. cxd4 exd4 22. Nxd4 Nxd4 23. Qxd4 Nxe4 24. Rfe1 Nc3 25. Qxd6
Rd8
26. Re7 Rxd6 0-1

[Event "ICC 30 30 (standard)"]
[Site "Internet Chess Club INT"]
[Date "2004.01.24"]
[Round "-"]
[White "ARCHANGEL"]
[Black "g8wrb"]
[Result "1-0"]
[WhiteElo "1774"]
[BlackElo "1145"]
[ECO "C53"]
[NIC "IG.02"]
[Opening "Giuoco Piano"]
[TimeControl "1800+30"]
[Time "14:40:19"]
[ICCResult "Black resigns"]

1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 d6 5. O-O Bg4 6. d4 Bb6 7. Bxf7+
Kxf7
8. Ng5+ Ke8 9. Qxg4 Qd7 10. Qxd7+ Kxd7 11. Nf7 Nf6 12. Nxh8 Rxh8 13.
d5 Ne7
14. Re1 h6 15. a4 g5 16. a5 Bc5 17. b4 Bxf2+ 18. Kxf2 Ng4+ 19. Kg1 Rg8
20.
h3 Nf6 21. Nd2 h5 22. Rf1 Nh7 23. Rf7 1-0

[Event "ICC 30 12 (standard)"]
[Site "Internet Chess Club INT"]

....etc etc


The games start with:

[Event "

and end when the next

[Event " starts. In other words, I can't assume a game ends on a new
line, or there are are blank lines between games.

On the first line, there is always the word "standard", "blitz" or
"bullet". I want to extract only the games which have the word
"standard" there, as in the first game. How can I do this?

I had a similar problem once before, when I want to suppress games
which started

[Event "ICC w

and someone gave me a script which works. Unfortunately, I can't seem
to adapt this, as I don't know enough about pattern matching to do it.
The following for example will output all the games which start

[Event "ICC 45

$ gawk '/^\[Event "/ { inhibit = ($0 ~ /^\[Event "ICC 45/) }
inhibit { print }' < icc.pgn

but I don't know how to adapt the bit around "ICC 45" to be "ICC
<something> (standard)"]

I thought a '*' could be used to match the <something> but that does
not appear to work. If anyone has any ideas, Here are a few more
games, which could be used for test purposes.

Dave


[Event "ICC 30 2 (standard)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "j256413"]
[Black "g8wrb"]
[Result "0-1"]
[WhiteElo "1295"]
[BlackElo "1258"]
[ECO "C01"]
[NIC "FR.01"]
[Opening "French defense"]
[TimeControl "1800+2"]
[Time "01:29:48"]
[ICCResult "White resigns"]

1. e4 e6 2. Nf3 d5 3. exd5 exd5 4. d4 Nf6 5. Nc3 Nc6 6. Be2 Bd6 7. O-O
O-O
8. h3 h6 9. a3 a6 10. Bd2 Re8 11. Re1 Bf5 12. Qc1 Kh7 13. g4 Ne4 14.
Bd3
Nxd2 15. Qxd2 Bxd3 16. Qxd3+ Kh8 17. Nxd5 Rxe1+ 18. Rxe1 Qd7 19. c4
Re8 20.
c5 Rxe1+ 21. Nxe1 Bf8 22. Nf3 Qxd5 23. Qf5 Qxf5 24. gxf5 Be7 25. d5
Na5 26.
Ne5 Kg8 27. c6 bxc6 28. dxc6 Bd6 29. Nd7 Nxc6 30. f6 gxf6 31. Nf8 Bxf8
0-1

[Event "ICC 5 12 u (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "g8wrb"]
[Black "chuchita"]
[Result "0-1"]
[WhiteElo "1051"]
[BlackElo "1189"]
[ECO "A01"]
[NIC "VO.08"]
[Opening "Nimzovich-Larsen attack: modern variation"]
[TimeControl "300+12"]
[Time "02:58:51"]
[ICCResult "White forfeits on time"]

1. b3 e5 2. Bb2 Nc6 3. e4 d6 4. h3 f5 5. d3 Nf6 6. Be2 Ne7 0-1

[Event "ICC 10 0 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "Monroe"]
[Black "g8wrb"]
[Result "1-0"]
[WhiteElo "1011"]
[BlackElo "1051"]
[ECO "A01"]
[NIC "VO.08"]
[Opening "Nimzovich-Larsen attack: modern variation"]
[TimeControl "600+0"]
[Time "08:45:23"]
[ICCResult "Black forfeits on time"]

1. b3 e5 2. Bb2 f6 3. g3 Bc5 4. Bg2 Nc6 5. d3 d6 6. Bxc6+ bxc6 7. Nd2
Rb8
8. e3 Qd7 9. e4 Qg4 10. Ngf3 Be6 11. O-O Ne7 12. Qe2 Qh3 13. Nh4 Bg4
14.
Ndf3 g5 15. Ng2 Ng6 16. c3 Kd7 17. d4 exd4 18. cxd4 Bb6 19. d5 Rhf8
20.
dxc6+ Kxc6 21. Qc2+ Kd7 22. Qd3 Rbe8 23. Rfe1 f5 24. exf5 Ne7 25. f6
Ng8
26. Nxg5 Qh6 27. f7 Rxf7 28. Nxf7 1-0

[Event "ICC 2 12 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "g8wrb"]
[Black "big579"]
[Result "0-1"]
[WhiteElo "1017"]
[BlackElo "1250"]
[ECO "A00"]
[NIC "VO.10"]
[Opening "Polish (Sokolsky) opening"]
[TimeControl "120+12"]
[Time "09:00:37"]
[ICCResult "White resigns"]

1. b4 e5 2. Bb2 d6 3. e4 Be7 4. Nf3 Nf6 5. d3 O-O 6. h3 Nc6 7. a3 a5
8. b5
Na7 9. Nc3 b6 10. d4 exd4 11. Nxd4 Nd7 12. Qf3 Bb7 13. Bd3 Bf6 14. Nf5
Ne5
15. Qg3 Ng6 16. Nd5 Bxb2 17. Rb1 Be5 18. Qe3 Bxd5 19. O-O Be6 20. Rfd1
Bxf5
21. exf5 Ne7 22. Be2 Nxf5 23. Qe4 Nd4 24. a4 Nxe2+ 25. Qxe2 Nc8 26.
Qe4 Ne7
27. Rd3 Ng6 28. Rbd1 Qh4 29. Qxh4 Nxh4 30. g3 Ng6 31. Rf3 Rfe8 32. c4
Bf6
0-1

[Event "ICC 10 0 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "moreno06"]
[Black "g8wrb"]
[Result "1-0"]
[WhiteElo "1320"]
[BlackElo "1007"]
[ECO "C00"]
[NIC "FR.02"]
[Opening "French: King's Indian attack"]
[TimeControl "600+0"]
[Time "09:10:57"]
[ICCResult "Black resigns"]

1. e4 e6 2. d3 d5 3. Nd2 Nc6 4. Ngf3 Bc5 5. c3 dxe4 6. dxe4 Qf6 7. Bb5
Ne7
8. O-O Bd7 9. Nb3 Bd6 10. Bg5 Qg6 11. Bd3 O-O-O 12. e5 Nf5 13. exd6
cxd6
14. Bxd8 Rxd8 15. Nh4 Qg5 16. Nxf5 exf5 17. Bb5 f4 18. a4 Bh3 19. Qf3
Ne5
20. Qxh3+ 1-0

[Event "ICC 2 10 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "g8wrb"]
[Black "royalsuicide"]
[Result "0-1"]
[WhiteElo "1004"]
[BlackElo "1361"]
[ECO "A00"]
[NIC "VO.10"]
[Opening "Polish (Sokolsky) opening"]
[TimeControl "120+10"]
[Time "09:21:39"]
[ICCResult "White forfeits on time"]

1. b4 e5 2. Bb2 Bxb4 3. Bxe5 Nf6 4. Nf3 Nc6 5. e3 Nxe5 6. Nxe5 d5 7.
Bb5+
c6 8. Ba4 Qd6 9. Nd3 a5 10. O-O O-O 11. a3 Bc5 12. Nxc5 Qxc5 13. Nc3
b5 14.
Bb3 a4 15. Ba2 Bg4 16. f3 Bh5 17. Re1 d4 18. exd4 Qxd4+ 19. Kh1 Rad8
20.
Ne2 Qh4 21. Ng3 Bg6 22. d4 c5 23. c3 cxd4 24. cxd4 Rxd4 25. Qe2 Rfd8
26.
Qxb5 Nh5 27. Nxh5 Bxh5 0-1

[Event "ICC 2 12 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "prutijayon"]
[Black "g8wrb"]
[Result "1-0"]
[WhiteElo "983"]
[BlackElo "1004"]
[ECO "D00"]
[NIC "QP.08"]
[Opening "Queen's pawn, Mason variation"]
[TimeControl "120+12"]
[Time "09:34:34"]
[ICCResult "Black resigns"]

1. d4 d5 2. Bf4 Nf6 3. f3 Bf5 4. g4 Bg6 5. e3 e6 6. Bg5 Be7 7. Bd3
Bxd3 8.
Qxd3 h6 9. Bxf6 Bxf6 10. Nd2 Nc6 11. c3 Qd6 12. Ne2 O-O-O 13. b4 b6
14. b5
Na5 15. a4 Rhe8 16. Rc1 e5 17. c4 exd4 18. e4 dxe4 19. Nxe4 Qe6 20. O-
O c5
21. Rfe1 Bh4 22. Nf4 Qd7 23. Re2 Qc7 24. Nd5 Qb7 25. Rcc2 Bf6 26. Nd6+
Rxd6
27. Rxe8+ Bd8 28. Qf5+ Qd7 29. Qxd7+ Kxd7 30. Re4 g6 31. f4 f5 32.
gxf5
gxf5 33. Re1 Nb3 34. Re5 d3 35. Rb2 d2 36. Rb1 Re6 37. Rxe6 Kxe6 38.
Rd1
Bc7 39. Kf1 h5 40. Nxc7+ Kd6 41. Nd5 Ke6 42. Ke2 Kf7 43. Rxd2 Nxd2 44.
Kxd2
Kg6 45. h4 Kg7 46. Kd3 Kg6 47. Ke3 Kg7 48. Ne7 a5 49. bxa6 1-0

[Event "ICC 2 12 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "g8wrb"]
[Black "prutijayon"]
[Result "0-1"]
[WhiteElo "981"]
[BlackElo "996"]
[ECO "A00"]
[NIC "VO.10"]
[Opening "Polish (Sokolsky) opening"]
[TimeControl "120+12"]
[Time "09:51:41"]
[ICCResult "White resigns"]

1. b4 d5 2. Bb2 f6 3. Nf3 e5 4. d4 e4 5. Nfd2 Bxb4 6. Nc3 Bxc3 7. Bxc3
Nc6
8. e3 a5 9. Bb5 Bd7 10. O-O Nb8 11. Rb1 c6 12. Be2 b5 13. Nb3 Ne7 14.
Nc5
b4 15. Bd2 Bc8 16. a4 Nd7 17. c3 Nxc5 18. dxc5 Ba6 19. Re1 Bxe2 20.
Qxe2
Rb8 21. cxb4 axb4 22. Rxb4 Rxb4 23. Bxb4 O-O 24. a5 Nc8 25. Ra1 Na7
26. Qa6
Qa8 27. Qb6 Rb8 28. Qa6 Rxb4 29. g4 Qb8 30. Qxa7 Qxa7 0-1

[Event "ICC 2 12 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "prutijayon"]
[Black "g8wrb"]
[Result "0-1"]
[WhiteElo "1008"]
[BlackElo "961"]
[ECO "A45"]
[NIC "QP.07"]
[Opening "Queen's pawn game"]
[TimeControl "120+12"]
[Time "09:59:49"]
[ICCResult "White resigns"]

1. d4 Nf6 2. c3 e6 3. Bg5 c5 4. Bxf6 Qxf6 5. Nf3 cxd4 6. Nxd4 Bc5 7.
e3 Nc6
8. Nxc6 dxc6 9. b4 Bb6 10. f3 Bxe3 11. Be2 e5 12. Qc2 Qh4+ 13. g3 Qh3
14.
Bf1 Qh5 15. Qe2 Qg5 16. Nd2 e4 17. Nxe4 Qh6 18. f4 Bb6 19. Rd1 O-O 20.
Rd6
f6 21. Qd3 Re8 22. Be2 Qg6 23. Nxf6+ gxf6 24. Qxg6+ hxg6 25. Rxf6 Kg7
26.
Rd6 Re6 27. Rxe6 Bxe6 28. a3 Re8 29. Kd2 Kf6 30. Re1 Rd8+ 31. Kc2 Kf5
32.
Bd3+ Kf6 33. Re5 Bf5 34. Bxf5 gxf5 35. Re2 Rh8 36. c4 Bg1 37. h4 Bd4
38. c5
Kf7 39. Kd3 Bf6 40. Kc4 Re8 41. Rxe8 Kxe8 42. b5 Kd7 43. b6 a6 44. a4
Ke7
45. a5 Ba1 46. Kd3 Bb2 47. h5 Kf6 48. g4 fxg4 49. Ke3 Kf5 50. h6 Bc1+
51.
Kf2 Bxf4 52. h7 Be5 53. Kg2 Ke4 0-1

[Event "ICC 2 12 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "g8wrb"]
[Black "prutijayon"]
[Result "0-1"]
[WhiteElo "989"]
[BlackElo "993"]
[ECO "A00"]
[NIC "VO.10"]
[Opening "Polish (Sokolsky) opening"]
[TimeControl "120+12"]
[Time "10:20:23"]
[ICCResult "White resigns"]

1. b4 e5 2. Bb2 f6 3. e4 Bxb4 4. c3 Bf8 5. d3 Nc6 6. Qd2 a5 7. f4 b5
8.
fxe5 Nxe5 9. Na3 b4 10. Nc4 Nxc4 11. dxc4 Ba6 12. Qd5 c6 13. Qd4 c5
14. Qe3
g5 15. O-O-O d6 16. Nf3 Qe7 17. Bd3 O-O-O 18. Rhe1 g4 19. Nh4 Bh6 0-1

[Event "ICC 10 2 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "Nickname"]
[Black "g8wrb"]
[Result "1-0"]
[WhiteElo "1273"]
[BlackElo "971"]
[ECO "C00"]
[NIC "FR.01"]
[Opening "French: Labourdonnais variation"]
[TimeControl "600+2"]
[Time "10:26:35"]
[ICCResult "Black resigns"]

1. e4 e6 2. f4 Bc5 3. Nf3 Nc6 4. d4 Bb6 5. Be3 Nf6 6. Nc3 O-O 7. Qd2
Re8 8.
e5 Nd5 9. Nxd5 exd5 10. O-O-O d6 11. h3 dxe5 12. dxe5 Be6 13. g4 Bxe3
14.
Qxe3 a5 15. a3 a4 16. f5 Bd7 17. Rxd5 Ra5 18. Rxa5 Nxa5 19. Qc5 Nc6
20. Bc4
Re7 21. Rd1 b6 22. Qxc6 Qe8 23. Qxc7 Qc8 24. Qxc8+ Bxc8 25. Rd8+ 1-0

[Event "ICC 10 2 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "g8wrb"]
[Black "Nickname"]
[Result "0-1"]
[WhiteElo "969"]
[BlackElo "1278"]
[ECO "A00"]
[NIC "VO.10"]
[Opening "Polish (Sokolsky) opening"]
[TimeControl "600+2"]
[Time "10:38:10"]
[ICCResult "White resigns"]

1. b4 e5 2. Bb2 d6 3. Nf3 Bf5 4. d3 Nf6 5. e4 Bg6 6. Nc3 Be7 7. g3 O-O
8.
Bh3 Nc6 9. Qe2 Nxb4 10. a3 Nc6 11. Qe3 h6 12. Bf5 Nh7 13. Bxg6 fxg6
14. Nd5
Bg5 15. Qe2 Ne7 16. Nxg5 Nxg5 17. Nxe7+ Qxe7 18. h4 Nf3+ 19. Kd1 Rf7
20. g4
Raf8 21. Kc1 Nxh4 22. Kb1 Rxf2 23. Qe3 b6 24. Qg3 Ng2 25. Rg1 R8f3 26.
Qxf3
Rxf3 27. Rxg2 Qe6 28. Rg1 g5 29. Bc1 d5 30. Ka2 dxe4+ 31. Kb2 exd3 32.
cxd3
Rxd3 0-1

[Event "ICC 10 2 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "Nickname"]
[Black "g8wrb"]
[Result "1-0"]
[WhiteElo "1283"]
[BlackElo "964"]
[ECO "C01"]
[NIC "FR.01"]
[Opening "French: exchange variation"]
[TimeControl "600+2"]
[Time "10:52:37"]
[ICCResult "Black resigns"]

1. e4 e6 2. d4 d5 3. exd5 exd5 4. Nc3 c5 5. Nf3 cxd4 6. Qxd4 Nf6 7.
Bg5 Be7
8. O-O-O O-O 9. Nxd5 Nxd5 10. Bxe7 Qa5 11. Qxd5 Qxd5 12. Rxd5 Re8 13.
Rd8
Rxd8 14. Bxd8 Nc6 15. Bc7 Be6 16. Bb5 Bxa2 17. b3 Nb4 18. c3 Nd5 19.
Bg3
Bxb3 20. Re1 g6 21. Be5 a6 22. Bd3 Rc8 23. Kb2 Ba4 24. Bd4 Bc6 25. Be3
Nxe3
26. fxe3 Rd8 27. Ne5 Bxg2 28. Bc4 Bd5 29. Bb3 Bxb3 30. Kxb3 Rd2 31.
Ng4 Rd6
32. Rf1 f5 33. Ne5 Rd2 34. h4 Rd3 35. Nc4 b5 36. Kc2 Rd8 37. Nb6 Rb8
38.
Nd5 Rd8 39. Rd1 Rb8 40. Nc7 Rb7 41. Nxa6 1-0

[Event "ICC 2 14 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "Doorn"]
[Black "g8wrb"]
[Result "1-0"]
[WhiteElo "1004"]
[BlackElo "960"]
[ECO "C02"]
[NIC "FR.01"]
[Opening "French: advance, Nimzovich system"]
[TimeControl "120+14"]
[Time "11:12:29"]
[ICCResult "Black resigns"]

1. e4 e6 2. Nf3 d5 3. e5 c5 4. d4 cxd4 5. Nxd4 Nc6 6. Bb5 Bd7 7. Nxc6
bxc6
8. Ba6 Qa5+ 9. Bd2 Qxa6 10. Qg4 Qb5 11. b3 Rb8 12. Na3 Qc5 13. b4 Qe7
14.
O-O c5 15. bxc5 Qxc5 16. Nb1 Nh6 17. Bxh6 gxh6 18. Nd2 Qxc2 19. Nb3
Be7 20.
Nd4 Qe4 21. Qxe4 dxe4 22. Rab1 Rxb1 23. Rxb1 Bc5 24. Rb8+ Ke7 25. Rxh8
Bxd4
26. Rxh7 Bxe5 27. Rxh6 Bf4 28. Rh4 e3 29. Rxf4 e2 30. Re4 Bb5 31. h4
Kf6
32. f3 Kg6 33. Kf2 f5 34. Rxe6+ Kh5 35. g3 a5 36. Re5 1-0

[Event "ICC 30 30 (standard)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "g8wrb"]
[Black "Vosburgh"]
[Result "0-1"]
[WhiteElo "1276"]
[BlackElo "1450"]
[ECO "C47"]
[NIC "KP.06"]
[Opening "Four knights: Italian variation"]
[TimeControl "1800+30"]
[Time "11:39:24"]
[ICCResult "White resigns"]

1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bc4 Be7 5. d3 O-O 6. h3 d6 7. O-O h6
8.
Be3 a6 9. a3 b5 10. Ba2 Be6 11. Bxe6 fxe6 12. b4 Qe8 13. Nh4 Nxe4 14.
Nxe4
Bxh4 15. Qg4 Bg5 16. Bxg5 hxg5 17. Nxg5 Rf6 18. Ne4 Rf4 19. Qg3 Nd4
20. c4
Ne2+ 0-1

[Event "ICC 30 30 (standard)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "Vosburgh"]
[Black "g8wrb"]
[Result "1/2-1/2"]
[WhiteElo "1459"]
[BlackElo "1267"]
[ECO "C01"]
[NIC "FR.01"]
[Opening "French: exchange variation"]
[TimeControl "1800+30"]
[Time "11:56:56"]
[ICCResult "Game drawn by mutual agreement"]

1. e4 e6 2. d4 d5 3. exd5 exd5 4. c4 c6 5. Nf3 Nf6 6. Be2 Bd6 7. O-O
h6 8.
Re1 O-O 9. Nc3 Re8 10. h3 Bf5 11. Be3 b6 12. a3 c5 13. dxc5 Bxc5 14.
Bxc5
bxc5 15. Nxd5 Nc6 16. Nxf6+ Qxf6 17. b3 Rab8 18. Nd2 Red8 19. Qc1 Qg5
20.
Nf3 Qxc1 21. Raxc1 Rxb3 22. Bf1 Rxa3 23. Ne5 Nxe5 24. Rxe5 Bd3 25.
Rxc5 Bf5
26. Rxf5 1/2-1/2

[Event "ICC 20 10 (standard)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "g8wrb"]
[Black "KrisS"]
[Result "1/2-1/2"]
[WhiteElo "1275"]
[BlackElo "1271"]
[ECO "C47"]
[NIC "KP.06"]
[Opening "Four knights: Italian variation"]
[TimeControl "1200+10"]
[Time "16:42:37"]
[ICCResult "Game drawn by mutual agreement"]

1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bc4 h6 5. h3 Bc5 6. O-O a6 7. a3 O-O
8.
b4 Bd6 9. d3 b5 10. Bb3 Nd4 11. Nxd4 exd4 12. Ne2 Be5 13. Bb2 c6 14.
Nxd4
Qc7 15. Rb1 Bh2+ 16. Kh1 Be5 17. Nf3 Bxb2 18. Rxb2 d6 19. Re1 Qb6 20.
Qd2
c5 21. Qe3 Bd7 22. bxc5 dxc5 23. c4 Be6 24. Reb1 Qc7 25. a4 bxc4 26.
Bxc4
Bxc4 27. dxc4 Rfb8 28. Rxb8+ Rxb8 29. Rxb8+ Qxb8 30. Qxc5 Qb1+ 31. Kh2
Qxe4
32. Qc8+ Kh7 33. Qxa6 Qf4+ 34. Kh1 Ne4 35. Qb6 Qc1+ 36. Kh2 Qf4+ 37.
Kh1
Nc3 38. Qe3 Qxc4 39. a5 Nd5 40. Qe1 Qa4 41. a6 Qxa6 42. Qe4+ Kg8 43.
Qxd5
Qf1+ 44. Kh2 Qxf2 45. Ne5 Qf4+ 46. Kh1 Qf1+ 47. Kh2 Qf4+ 1/2-1/2

[Event "ICC 2 12 u (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "bugbear"]
[Black "g8wrb"]
[Result "1-0"]
[WhiteElo "1542"]
[BlackElo "946"]
[ECO "D02"]
[NIC "QP.08"]
[Opening "Queen's pawn game, Chigorin variation"]
[TimeControl "120+12"]
[Time "17:41:32"]
[ICCResult "Black resigns"]

1. d4 d5 2. Nf3 Nc6 3. Bf4 Bf5 4. h3 Nf6 5. e3 e6 6. a3 Bd6 7. Ne5 O-O
8.
Nd2 Ne4 9. Bd3 Nxe5 10. Bxe5 Bxe5 11. dxe5 Nc5 12. Bxf5 exf5 13. O-O
Re8
14. f4 Ne4 15. Nxe4 fxe4 16. Qe2 c6 17. Rad1 Qh4 18. c4 Rad8 19. cxd5
cxd5
20. Qb5 Re7 21. Rxd5 Rxd5 22. Qxd5 h6 23. Qxe4 b6 24. Rd1 Re8 25. Rd7
Re7
26. Rd8+ 1-0

[Event "ICC 2 12 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "g8wrb"]
[Black "Shadetree"]
[Result "1-0"]
[WhiteElo "946"]
[BlackElo "1400"]
[ECO "A00"]
[NIC "VO.10"]
[Opening "Polish (Sokolsky) opening"]
[TimeControl "120+12"]
[Time "17:50:18"]
[ICCResult "Black forfeits on time"]

1. b4 d5 2. Bb2 Nf6 3. d4 c6 4. Nf3 e6 5. Ne5 Bd6 6. a3 Ne4 7. e3 a6
8. f3
1-0

[Event "ICC 2 12 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "g8wrb"]
[Black "goranbolin"]
[Result "0-1"]
[WhiteElo "946"]
[BlackElo "1133"]
[ECO "A00"]
[NIC "VO.10"]
[Opening "Polish (Sokolsky) opening"]
[TimeControl "120+12"]
[Time "18:02:16"]
[ICCResult "White resigns"]

1. b4 e5 2. Bb2 f6 3. Nf3 d5 4. d4 Bxb4+ 5. Bc3 Bxc3+ 6. Nxc3 e4 7.
Nd2 Ne7
8. e3 O-O 9. Rb1 c6 10. Be2 Qa5 11. Rb3 b5 12. a3 Na6 13. Ndb1 b4 14.
axb4
Nxb4 15. O-O Rb8 16. Ra3 Qc7 17. Qd2 a5 18. Na4 Ng6 19. c3 Nd3 20.
Bxd3
exd3 21. Qxd3 Qd7 22. Nd2 Qg4 23. Nf3 Bf5 24. Qa6 Be4 25. Qe2 Rb1 26.
Rxb1
Bxb1 27. Rb3 Be4 28. Rb6 Nh4 0-1

[Event "ICC 2 12 (blitz)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "goranbolin"]
[Black "g8wrb"]
[Result "1-0"]
[WhiteElo "1153"]
[BlackElo "938"]
[ECO "C01"]
[NIC "FR.08"]
[Opening "French: Winawer (Nimzovich) variation"]
[TimeControl "120+12"]
[Time "18:16:38"]
[ICCResult "Black resigns"]

1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. exd5 exd5 5. Bd2 Nf6 6. Bd3 O-O 7.
Nge2 Re8
8. O-O Bg4 9. f3 Bh5 10. Nf4 g5 11. Nxh5 Nxh5 12. f4 Be7 13. Qxh5 gxf4
14.
Qxh7+ 1-0

[Event "ICC 20 0 (standard)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "g8wrb"]
[Black "shadowfire"]
[Result "0-1"]
[WhiteElo "1275"]
[BlackElo "1367"]
[ECO "C10"]
[NIC "FR.07"]
[Opening "French: Rubinstein variation"]
[TimeControl "1200+0"]
[Time "19:48:47"]
[ICCResult "White resigns"]

1. e4 e6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Nf6 5. Nf3 Nxe4 6. Bd3 0-1

[Event "ICC 25 15 (standard)"]
[Site "Internet Chess Club"]
[Date "2006.08.17"]
[Round "-"]
[White "perplexed"]
[Black "g8wrb"]
[Result "1-0"]
[WhiteElo "1358"]
[BlackElo "1264"]
[ECO "D10"]
[NIC "SL.01"]
[Opening "QGD Slav defense"]
[TimeControl "1500+15"]
[Time "20:13:22"]
[ICCResult "Black resigns"]

1. d4 d5 2. c4 c6 3. Nc3 Nf6 4. Bg5 Be6 5. Nf3 h6 6. Bh4 Qd6 7. c5 Qc7
8.
e3 Nbd7 9. Bg3 Qa5 10. a3 Bf5 11. b4 Qd8 12. Bd3 Bxd3 13. Qxd3 b5 14.
O-O
e6 15. a4 a6 16. axb5 axb5 17. Nxb5 Be7 18. Nc7+ Kf8 19. Rxa8 1-0

[Event "ICC 30 10 (standard)"]
[Site "Internet Chess Club"]
From: Alan Curry on
In article <b233480b-a7d5-4ba8-a3e2-8147d6b3825f(a)u34g2000yqu.googlegroups.com>,
Dr. David Kirkby <david.kirkby(a)onetel.net> wrote:
|
|The games start with:
|
|[Event "
|
|and end when the next
|
|[Event " starts. In other words, I can't assume a game ends on a new
|line, or there are are blank lines between games.

Are you sure? In PGN export format, each tag is required to be on a line by
itself and blank lines between games are required. In PGN import format, you
can't even count on the Event tag existing.

--
Alan Curry
From: Dr. David Kirkby on
On Apr 13, 7:58 am, pac...(a)kosh.dhis.org (Alan Curry) wrote:
> In article <b233480b-a7d5-4ba8-a3e2-8147d6b38...(a)u34g2000yqu.googlegroups..com>,
> Dr. David Kirkby <david.kir...(a)onetel.net> wrote:
> |
> |The games start with:
> |
> |[Event "
> |
> |and end when the next
> |
> |[Event " starts. In other words, I can't assume a game ends on a new
> |line, or there are are blank lines between games.
>
> Are you sure? In PGN export format, each tag is required to be on a line by
> itself and blank lines between games are required. In PGN import format, you
> can't even count on the Event tag existing.
>
> --
> Alan Curry

I''ll rephrase that. I can't rely on a record ending when there is a
blank line, as there are often blank lines between the tags and the
moves - in fact, looking at the standard, such a blank line is
required in export format.

For my own purposes, I can be sure there is an Event tag, as the pgn
file will have been exported by a program, and so must have the
following 7 tags

1) Event (the name of the tournament or match event)
2) Site (the location of the event)
3) Date (the starting date of the game)
4) Round (the playing round ordinal of the game)
5) White (the player of the white pieces)
6) Black (the player of the black pieces)
7) Result (the result of the game)

So I can be 100% sure there will be an Event tag.

Also, in the PGN standard, there is no need for the Event tag to have
the words standard, blitz or bullet, but I know my files will have, as
these have been added by some code that someone else posted in
response to a request of mine a year or so ago.

The PGN files were generated by a computer (ICC server) and have been
processed by me in several ways using 'pgn-extract' and some awk
scripts.

Dave
From: pk on
Dr. David Kirkby wrote:

> On Apr 13, 7:58 am, pac...(a)kosh.dhis.org (Alan Curry) wrote:
>> In article
>> <b233480b-a7d5-4ba8-a3e2-8147d6b38...(a)u34g2000yqu.googlegroups.com>, Dr.
>> David Kirkby <david.kir...(a)onetel.net> wrote:
>> |
>> |The games start with:
>> |
>> |[Event "
>> |
>> |and end when the next
>> |
>> |[Event " starts. In other words, I can't assume a game ends on a new
>> |line, or there are are blank lines between games.
>>
>> Are you sure? In PGN export format, each tag is required to be on a line
>> by itself and blank lines between games are required. In PGN import
>> format, you can't even count on the Event tag existing.
>
> I''ll rephrase that. I can't rely on a record ending when there is a
> blank line, as there are often blank lines between the tags and the
> moves - in fact, looking at the standard, such a blank line is
> required in export format.

So to be clear, do you need to exclusively rely upon seeing "[Event" to
identify the start of a game, or can you just assume that a game is composed
of two "paragraphs", where paragraphs are separated by runs of empty lines?

From: Bill Marcum on
On 2010-04-13, Dr. David Kirkby <david.kirkby(a)onetel.net> wrote:
> The following for example will output all the games which start
>
> [Event "ICC 45
>
> $ gawk '/^\[Event "/ { inhibit = ($0 ~ /^\[Event "ICC 45/) }
> inhibit { print }' < icc.pgn
>
> but I don't know how to adapt the bit around "ICC 45" to be "ICC
><something> (standard)"]
>
> I thought a '*' could be used to match the <something> but that does
> not appear to work. If anyone has any ideas, Here are a few more
> games, which could be used for test purposes.
>
Use '.*' to match any string in regular expressions. '.' matches any single
character and '*' matches any number of the previous item.