'PGN splitter by Axel Nordin NumGames=500 'How many games you want in each new file nam$=Open dialog$ sav$=Save dialog$ f=Open file(nam$) 'Open the file NF$=sav$+"("+str$(1)+").pgn" nfp=open file(NF$) 'Open the save file Output: while EOF(f)=false line input f,s$ if instr(s$,"Event ") then SGames=SGames+1 if SGames=NumGames then ? SGames ? s$ SGames=0 close file nfp NN=NN+1 NF$=sav$+"("+str$(NN)+").pgn" nfp=open file(NF$) fwrite nfp,s$ goto Output end if end if fwrite nfp,s$ wend close file nfp close file f