Is there a way to combine several PGN’s into one PGN?

Sort:
Avatar of TuckerTommy
Is there a way to combine several PGN’s into one PGN?
Avatar of ChessianHorse
I’m not quite sure what you mean by that. You could give the second game as a variation using brackets () I guess.
Avatar of EscherehcsE
TuckerTommy wrote:
Is there a way to combine several PGN’s into one PGN?

Yeah, there are several ways to do it. In general, the smaller the PGN files, the easier the task. Here's a thread that discussed merging large PGN files. (The thread began by discussing endgame tablebases, but midway down the first page (Post #8), the discussion evolved into one of merging PGN files.)

https://www.chess.com/forum/view/chess-equipment/arena-3-5-and-egtb-s-part-2?page=1

Avatar of Ziggy_Zugzwang

I don't suppose there's anyway to download all chess.com played games into one giant PGN file is there - anyone ?

Avatar of EscherehcsE
Ziggy_Zugzwang wrote:

I don't suppose there's anyway to download all chess.com played games into one giant PGN file is there - anyone ?

I'm not the guy to answer that question - I haven't played any games here, plus I'm still using V2, which no longer allows downloading PGN files. But I think others have said that you can only download PGN files in blocks of 50, or something like that. Maybe someone else can give a more knowledgeable answer.

Avatar of mgx9600

If your single game is split into multiple PGNs and you want to merge them into a single PGN, then you just need to concatenate the movetext sections of the PGNs.  The PGN reader is (by official decree , which I forgot where I read it from) supposed to be lenient on parsing (because PGNs were designed for human edits); this means it should ignore inconsistencies in turn numbers.

 

Avatar of Martin_Stahl
Ziggy_Zugzwang wrote:

I don't suppose there's anyway to download all chess.com played games into one giant PGN file is there - anyone ?

 

There isn't a way to do it directly or site supported. Someone posted a way that might work if you have the right utilities (using curl maybe) and can script it but I don't know for sure it works. Would have to see if I can find the topic again.

 

edit: nevermind, it was about something else, though I'm sure a method could be scripted to get everything if you are good at it and had the right utilities grin.png

Avatar of batgirl

 

The simplest method is to start a new page in a text editor such as Windows Notepad and paste the pgns successively into that one editor page, then save it "as" xxxxx.pgn.

 

e.g. (from Notepad)

null

Avatar of TuckerTommy

I did this but the PGN readers are not seeing the PGN file I created in notepad.

Avatar of batgirl

If the pgns are correctly formatted and you saved it as a pgn file, then  your pgn reader probably doesn't support multiple pgns   Winboard will read these.

Avatar of Logan-Paul
batgirl wrote:

If the pgns are correctly formatted and you saved it as a pgn file, then  your pgn reader probably doesn't support multiple pgns   Winboard will read these.

how do i get a thing next to my name?

i see people with stars, diamonds, crowns and pawns

Avatar of Martin_Stahl
Logan-Paul wrote:
batgirl wrote:

If the pgns are correctly formatted and you saved it as a pgn file, then  your pgn reader probably doesn't support multiple pgns   Winboard will read these.

how do i get a thing next to my name?

i see people with stars, diamonds, crowns and pawns

 

For stars, diamonds and crowns, you have to purchase a premium membership.

https://www.chess.com/membership

 

Pawns are moderators, if they are blue, and staff if they are green.

Avatar of Logan-Paul

ohh ok thanks

Avatar of DerekMcCormack

Komodo 10 - select all pgn games in database - edit - merge

Avatar of maximizer2021

Very Simple. 

1. Create a new Folder - for example on your Desktop

2. Copy all the PGNs into this Folder

3. Open a "Command Prompt" in Windows - it will open the command prompt in your users work directory like C:\Users\Chessuser - Chessuser is the Username

4. change the Directory to "Desktop" - tpye: cd Desktop

5. change to the Directory - type: cd FOLDERNAME - enter your Foldername

6. now check if you can see all the PGN Files: type: dir

You should now see the PGN Files

7. Now: To Merge all PGN Files into single File --> use / type: type *.pgn > 1\output.pgn

8. Thats it happy.png

 

Avatar of maximizer2021

sorry there was a small mistake: type *.pgn > output.pgn - thats it "\1" is for a folder if exists

 

Avatar of TestedVisitor

Go to PGN directory Merge all PGN Files into single File --> open command line cmd.exe

copy *.pgn  c:\output.pgn

Avatar of Dr_Akhil_Vashist

Hey i downloaded Hikaru's games as white and all of those games are already in 1 PGN file but they are seperated game by game. What i want is to have them all as variation in one game rather than having many games in one pgn file. Is there a way to combine all those games present in that single pgn file as variations in a same game?

 

P.S i tried scid but it has the option merge this game, so it does it game by game like i have to do merge it for every single game thousands of times, I WANT SOMETHING LIKE 'MERGE ALL'..

Avatar of EscherehcsE
atharva011 wrote:
Dr_Akhil_Vashist wrote:

Hey i downloaded Hikaru's games as white and all of those games are already in 1 PGN file but they are seperated game by game. What i want is to have them all as variation in one game rather than having many games in one pgn file. Is there a way to combine all those games present in that single pgn file as variations in a same game?

 

P.S i tried scid but it has the option merge this game, so it does it game by game like i have to do merge it for every single game thousands of times, I WANT SOMETHING LIKE 'MERGE ALL'..

I'm having a similar doubt, bumping to look for answers

Why anyone would want to put a million variations into a single game is beyond my comprehension. You're supposed to use the GUI's tree window for this type of issue.

Avatar of Olle_Eriksson

I looked everywhere for a command line tool to merge PGN's into one (and I mean really merging the PGN games into one game with variations, either from one file, or from separate files). I found one Python script on GitHub that I modified to have support for also merging text comments and also software comments / annotation (arrows and circles etc). There are some technical caveats but it works:

https://github.com/olleeriksson/merge-pgn

For those who can't be bothered to install python, and who doesn't have Chessbase, chesstempo.com is another free tool that also does real PGN game merging, but there are some issues with that. In order to get a clean merge, you have to remove all existing repertoires and reload the page before uploading the PGN files to merge, and then export them. If you are already using the opening trainer at chesstempo.com you would have to first export/backup your repertoires and then re-upload them afterwards which could be a nuisance. Also, while it does merge the text comments, it doesn't really merge the annotations (arrows and circles), and it will also include annotations from repertoires of the opposite color (hence the reason why you need to remove all repertoires before you begin). There is a discussion regarding these subtleties at https://old.chesstempo.com/chess-forum/help_and_support/any_way_to_delete_cal_comments_from_repertoire-t11246.0.html;msg76376#msg76376.