ChessUSA.com TalkChess.com
Hosted by Your Move Chess & Games
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to create a labeled epd from pgn?
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Flat
View previous topic :: View next topic  
Author Message
Alexandru Mosoi



Joined: 16 Jan 2015
Posts: 426

PostPost subject: Re: how to create a labeled epd from pgn?    Posted: Sat Dec 02, 2017 11:12 am Reply to topic Reply with quote

Given a set of PGNs I use the following command (works on my Debian)

Code:

cat ok/pgn-split.* | grep "FEN\|Result\|ECO" | tac | paste - - -d' ' | grep -v ECO | sed 's/\[FEN "//' | sed 's/0 1"\] \[Result/c9/' | sed 's/\]/;/' > quiet-labeled.epd



Let's split:

Code:
cat ok/pgn-split.*
just concatenates everything
Code:
grep "FEN\|Result\|ECO"
keeps only the lines containing FEN, ECO or RESULT
Code:
tac
reverses the lines
Code:
paste - - -d' '
merges the lines two by two
Code:
grep -v ECO
removes ECO lines. Some cutechess versions output ECO instead of FEN
Code:
sed 's/\[FEN "//' | sed 's/0 1"\] \[Result/c9/' | sed 's/\]/;/'
removes extra characters and adds c9.
_________________
zurichess - http://www.zurichess.xyz
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Subject Author Date/Time
how to create a labeled epd from pgn? Erin Dame Sat Dec 02, 2017 2:33 am
      Re: how to create a labeled epd from pgn? Álvaro Begué Sat Dec 02, 2017 6:49 am
            Re: how to create a labeled epd from pgn? Erin Dame Sat Dec 02, 2017 10:32 am
                  Re: how to create a labeled epd from pgn? Alexandru Mosoi Sat Dec 02, 2017 11:12 am
                        Re: how to create a labeled epd from pgn? Álvaro Begué Sat Dec 02, 2017 3:08 pm
                              Re: how to create a labeled epd from pgn? Erin Dame Sat Dec 02, 2017 3:18 pm
      Re: how to create a labeled epd from pgn? Jon Dart Sat Dec 02, 2017 2:20 pm
            Re: how to create a labeled epd from pgn? Erin Dame Sat Dec 02, 2017 2:37 pm
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
Enhanced with Moby Threads