Word file into pgn file?

Sort:
breathedeeper

Hello Chess.com friends!

Any tech-saavy folks know how to convert a Word file into a pgn file?  I have some annotated games in a Word file and wonder if there is a way to easily convert without manually inputing each move/annotation.  

Just to be clearer:  After the Word file is converted to a pgn, the moves (and their variations) would be recognized as moves by the pgn (and not just text).  So, you could scroll through the moves as you could in any other pgn. 

Thanks for any input! 

George  

corum

A pgn file is, as far as I understand it, just a text file. 

 

If you want to scroll through your moves as you suggest, you need a viewer. There are lots of those about that allow you to take your pgn text file and paste it in. Once you have done that you will be able to step through the game exactly as you want to. 

For interest, I use something called Chessx (which is free and also allows nice annotations etc) on my mac.

So, as long as your word file has the same format as a pgn file then you would simply copy it and paste it into the viewer, and off you go. 

 

Now, I am guess that your word file text is not quite in the right format and that this is your problem. However, it would not take long to edit the information in your word file to get it in the right format. 

 

This is what a pgn file looks like:

[Event "F/S Return Match"]
[Site "Belgrade, Serbia JUG"]
[Date "1992.11.04"]
[Round "29"]
[White "Fischer, Robert J."]
[Black "Spassky, Boris V."]
[Result "1/2-1/2"]

1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 {This opening is called the Ruy Lopez.}
4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d4 Nbd7
11. c4 c6 12. cxb5 axb5 13. Nc3 Bb7 14. Bg5 b4 15. Nb1 h6 16. Bh4 c5 17. dxe5
Nxe4 18. Bxe7 Qxe7 19. exd6 Qf6 20. Nbd2 Nxd6 21. Nc4 Nxc4 22. Bxc4 Nb6
23. Ne5 Rae8 24. Bxf7+ Rxf7 25. Nxf7 Rxe1+ 26. Qxe1 Kxf7 27. Qe3 Qg5 28. Qxg5
hxg5 29. b3 Ke6 30. a3 Kd6 31. axb4 cxb4 32. Ra5 Nd5 33. f3 Bc8 34. Kf2 Bf5
35. Ra7 g6 36. Ra6+ Kc5 37. Ke1 Nf4 38. g3 Nxh3 39. Kd2 Kb5 40. Rd6 Kc5 41. Ra6
Nf2 42. g4 Bd3 43. Re6 1/2-1/2

Let's paste this into the game editor in this message and see what we get:

 

So that works well. 

Ok. imagine you have this (I will just show the first 7 moves) in your word file:

 

1. e4 e5

2. Nf3 Nc6

3. Bb5 a6

4. Ba4 Nf6

5. O-O Be7

6. Re1 b5

7. Bb3 d6

 

It doesn't look like the example above. There is no header and there is a return after each pair of moves whereas there isn't a return in the pgn file. Well, we could easily fix these things and edit the file to make it look like a pgn file. But do you need to? Let's just copy these 7 pairs of moves and paste them into the game editor and see what happens:

 

 

Pretty cool. It works. Not header. No need to worry about the returns between the moves. 

 

What about this:

 

1. e4

e5

2. Nf3

Nc6

3. Bb5

a6

4. Ba4

Nf6

5. O-O

Be7

6. Re1

b5

7. Bb3

d6

Will this work?

Yep. 

 

So you can see that the pgn format is pretty forgiving. 

So you can probably take your word file, copy it, and paste it into a viewer. If your word file format is particularly perverse you might need to edit it a bit. And you probably need to make sure that you use Standard Algebraic Notation https://en.wikipedia.org/wiki/Algebraic_notation_(chess)

breathedeeper

Wow!  Thank you for such an excellent response.  I happen to use ChessX, but when I paste the file into a "new game" it just shows up as text.  The moves are not in bold, and I am not able to scroll through the moves.  

When you say "game editor" I don't see that feature on ChessX.  Could you help clarify?

namor87

Hi,

Can you post the Word file, or copy-paste the content? A content of a Word document can be anything really.
Probably your game in Word document has wrong format for ChessX to recognize. Or when you copy from Word you also copy some whitespace characters that ChessX might have problems with. It's hard to say anything concrete without having a look at the document syntax.

 

breathedeeper

Hi Namor, 

Here is an example: 

 

1...Rhc8? a weak move that doesn’t do anything

against White’s active plan.

2.g4! g6 3.f5 gxf5 4.gxf5 Rg8?

Another weak move that doesn’t prevent White’s

threat of playing f5-f6.

Better was: 4...exf5 5.Nf4 Be6 6.Rg1 even if White

keeps an advantage.

SmithyQ

Here is the PGN that produced the above.  In short, make sure comments have the curly brackets and variations are enclosed in brackets:

1.e4 { Comments need to have hte following format, or it won't work. } 1...e5 2.Nf3 Nc6 3.Bb5 ( 3.d4 { And variations need this type of formating to work } 3...exd4 4.Nxd4 ) *

breathedeeper

Most excellent!  Thank you.  I'll try to add the brackets and paste into ChessX.  Will follow up with how this goes in a later post.  

 

 

SmithyQ

Note that, depending how finicky the program is, other common errors include castling (using zeroes instead of oh's, or vice versa) and not including a game status at the end (so 1-0 for White wins, or * for still in progress).  

What I have learned to do is, instead of typing out my pgn in hand, is to make the moves in Chessbase or similar, add comments and variations, and then have it create the pgn.  Of course, doing it this way may defeat the purpose of making a pgn file in the first place ... but at least you won't have any errors.

corum

on ChessX by the way, you select edit and paste into new game, assuming your game is in your clipboard.

batgirl

Open the Word file and save it as .pgn instead of .doc. If that doesn't work, open it with MS Notepad (or copy/paste the text into Notepad) and save it as .pgn instead of .txt.  That always works.