hey guys, im helping a friend to get a database for his thesis. it is about chess.
We found a chess database, and with the program that is delivered with it, there is a function to output the 5,7 mln games database as a PGN file. but because there is a 2gb file limit, you can only make chunks of the database of 1.2 GB (about 25% of 5,7 mln games)
it looks like this(and than repeated over and over again per game:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
[Event "Valencia"]
[Site "Valencia"]
[Date "1475.??.??"]
[Round "?"]
[White "De Castellvi, Francisco"]
[Black "Vinoles, Narcisco"]
[Result "1-0"]
[ECO "B01"]
[PlyCount "41"]
[EventDate "1475.??.??"]
[EventType "game"]
[EventCountry "ESP"]
[Source "ChessBase"]
[SourceDate "2007.11.25"]
1. e4 d5 2. exd5 Qxd5 3. Nc3 Qd8 4. Bc4 Nf6 5. Nf3 Bg4 6. h3 Bxf3 7. Qxf3 e6 8.
Qxb7 Nbd7 9. Nb5 Rc8 10. Nxa7 Nb6 11. Nxc8 Nxc8 12. d4 Nd6 13. Bb5+ Nxb5 14.
Qxb5+ Nd7 15. d5 exd5 16. Be3 Bd6 17. Rd1 Qf6 18. Rxd5 Qg6 19. Bf4 Bxf4 20.
Qxd7+ Kf8 21. Qd8# 1-0
|
so i made this code that works, at least it works for the first chunk(1,5GB)
at the second chunk it crashes around 26mb of output(at about 13%)
Also the 3rd chunk somehow crashes, but then at 49,9%(105mb of output approx.). i tried to rerun the program, but it always crashes at the same point.
the program reads line by line using the getline function.
it makes strings, and everytime you find a piece of information you put it in a string, and when you find ''[event '' it outputs all strings.(if no information was found it gives NOval.
Do you guys have any idea why the program could crash? i rename the chunks everytime to Allespgn.pgn and then store the output (does that matter?)
greetings,
Roland