Save game by player SGBP v2
Readme (1febjan2015)

A. Purpose
The script will extract games by player and color sorted by date latest first
given a single pgn file.

B. Required files
1. pgn-extract-17-14.exe or pgn-extract-17-19.exe or anything that starts in pgn-extract-17-
2. your pgn file, say fct1 2015.pgn
3. pgnsort.py
4. SaveGamesByPlayersAndColor-2.py

C. Required programs
1. python
This was tested to work in python version 2.7.2 and 3.4.1

D. Operating system
This tool is tested in windows 7

E. How to use it
1. Create any directory say extract_games and copy the files in section B (or required files)
into the newly created directory
2. Install python so that python script will work
3. Run the file SaveGamesByPlayersAndColor-2.py

F. Output
1. The script will create a directory called out_pgn. The generated pgn files by player and color
will be saved here, games are sorted by dates, latest first. Existing out_pgn directory will be deleted.
2. The src.pgn will not be deleted
3. The plist.txt is created, this file contains the player list from the src.pgn.
The script will overwrite this file everytime you start the script
4. Filenames of pgn files are based on player names

G. How it works
1. The script will scan a pgn file to get all players, white and black into a plist.txt.
2. Then it will remove duplicate players, so what remains will be unique player list
3. The script will scan these players and use pgn-extract program to extract games per player and color
4. After extraction the games in each pgn file are sorted using a script pgnsort.py created by Marcel van Kervinck.
5. After sorting, the file will be moved to out_pgn directory

H. Files in this package
1. SaveGamesByPlayersAndColor-2.py
2. readme v2.txt
3. pgnsort.py

I. History
v1 (28jan2015)
1. First release

v2 (1feb2015)
1. Auto detect pgn-extract-17-*.exe file, say pgn-extract-17-14.exe, or pgn-extract-17-19.exe, 
and future version of pgn-extract that starts pgn-extract-17-.
2. Auto delete existing out_dir before saving new extracted games
3. Accepts any source pgn filenames, with or without spaces, example, fct1 2015.pgn.



