Combining multiple pgn databases into one big database

This forum is for general discussions and questions, including Collectors Corner and anything to do with Computer chess.

Moderators: Harvey Williamson, Steve B, Watchman

Forum rules
This textbox is used to restore diagrams posted with the fen tag before the upgrade.
Post Reply
Juraldo
Member
Posts: 3
Joined: Wed Apr 15, 2015 9:24 pm

Combining multiple pgn databases into one big database

Post by Juraldo »

Hello,

I recently purchased deep hiarcs for mac, as I was interested in it. So far I like the design and simplicity of it, but I am having problems with big databases. I have a database of around 150 twic and I would like to merge into one big database. So far, the only way I see possible is to manually open every single twic pgn and copy it into one big database. It is a tiring process and hiarcs crashed in the process so I thought I would ask for an opinion here. I found a post where someone explained how to merge multiple pgns on windows, but could not find a solution for mac. Thanks for the help!
chrka
Member
Posts: 12
Joined: Wed Oct 31, 2012 7:14 pm

Post by chrka »

There are a few simple ways of doing what you want. One convenient way is to use the "Automator" application (it's very simple to learn if you haven't used it yet) to create an application to merge the files. You could even use it to create a folder which merges any files put into it.

You could also use the "Terminal" application to merge the files. Here's one way to do it (I'm assuming you haven't used it before, so forgive me if I'm being a bit longwinded.) 1) Put the PGN-files you want to merge in a folder. 2) Open Terminal. 3) type "cd " in the window and drag the folder to it, then hit enter 4) type "cat *.pgn <output>.pgn" (replace <output> with whatever you want to call the file) and hit enter
Juraldo
Member
Posts: 3
Joined: Wed Apr 15, 2015 9:24 pm

Post by Juraldo »

Thanks for the help but it doesnt work. Terminal gives me no such directory notice on pgn, name and last pgn separately. I will try automator, although I have no experience with it.
chrka
Member
Posts: 12
Joined: Wed Oct 31, 2012 7:14 pm

Post by chrka »

Sorry, looks as if an important character disappeared somewhere along the way.

I'll give you a sample transcript instead. Let's say you've got a folder named "Chess" in your documents folder with some pgn files in it that you want to merge into a file "Merged.pgn". Then you'd enter the following two lines (the file path in the first line is what you can get easier by dragging the folder into the terminal window).

cd /Users/Juraldo/Documents/Chess
cat *.pgn > Merged.pgn

'cd' changes the working directory, and 'cat' concatenates files to the terminal. The '>' in the second line (that was missing in my previous post) redirects anything that is output into a file instead, ie., the concatenation of the PGN files.

If you don't have any luck with the Automator, let me know and I can send you a simple script.
dntfeedthemnkys

Post by dntfeedthemnkys »

chrka wrote:Sorry, looks as if an important character disappeared somewhere along the way.

I'll give you a sample transcript instead. Let's say you've got a folder named "Chess" in your documents folder with some pgn files in it that you want to merge into a file "Merged.pgn". Then you'd enter the following two lines (the file path in the first line is what you can get easier by dragging the folder into the terminal window).

cd /Users/Juraldo/Documents/Chess
cat *.pgn > Merged.pgn

'cd' changes the working directory, and 'cat' concatenates files to the terminal. The '>' in the second line (that was missing in my previous post) redirects anything that is output into a file instead, ie., the concatenation of the PGN files.

If you don't have any luck with the Automator, let me know and I can send you a simple script.

This was super awesome. Thank you.
Post Reply