I don't understand what you meant by pgn split, but I once purchased a chess pgn book and it has all the games (312) in one pgn file. Now I need to split it into each chapter with exactly 12 games each. I searched over the internet and didn't manage to find anything helpful. So I wrote a python program to divide it into separate files.
import os
name = 'Your pgn file here'
units = 12
test_sub = "[E"
path = 'F:/Chess/pgns/'
file = ''
with open(path+name+'.txt', encoding="utf8") as f:
test_str = f.read()
# using list comprehension + startswith()
# All occurrences of substring in string
res = [i for i in range(len(test_str)) if test_str.startswith(test_sub, i)]
print('No of games in each pgn =',units)
print('Total games found =',len(res))
print('Splitting',len(res),'games into',len(res)//units,'pgns.....')
os.mkdir(path+name)
for i in range(len(res)//units):
file = path+name+'/'+name+'- Unit-'+str(i+1)+'.pgn'
if i==len(res)//units-1:
with open(file, 'w', encoding="utf8") as file:
file.write(test_str[res[i*units]:len(test_str)])
else:
with open(file, 'w', encoding="utf8") as file:
file.write(test_str[res[i*units]:res[(i+1)*units]-1])
print('Success!!')
Note: This divides the given pgn into equal number of files mentioned as units
in the program, it doesn't divide a pgn into separate pgn's based on variations.