On Sun, Apr 29, 2012 at 09:02:51AM -0500, Mike Curtis wrote: > > Basically a for next loop that selects the start position of tactical > > position from the pgn file, then searches for the position in the big > > database, and saves it into a new database. > > > > Can that be done with scid? > > Yes. > > > Thanks > > --8<---------------cut here---------------start------------->8--- > #!/bin/bash > # scid_search <database_name> <epd_file> \ > exec tkscid "$0" "$@" > puts stderr "opening [lindex $argv 0]..." > sc_base open [lindex $argv 0] > set fp [open [lindex $argv 1] r] > while { [gets $fp position] > 0 } { > puts stderr $position > sc_game startBoard $position > sc_filter clear > sc_search board AND Exact false 0 > if { [sc_filter count] > 0 } { > sc_game load [sc_filter first] > puts [sc_game pgn] > } > } > close $fp > exit > --8<---------------cut here---------------end--------------->8---
> awk -F\" '/^\[FEN / {print $2}' positions.pgn > positions.epd > ./scid_search database_name positions.epd | tee found.pgn > pgnscid found.pgn That's impressive! Is there some docs regarding this, or did you work it *all* out from the source and knowledge of Tk/Tcl? P.S. Should the "\" be there on: # scid_search <database_name> <epd_file> \ ^ -- "Religion is excellent stuff for keeping common people quiet." -- Napoleon Bonaparte ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Scid-users mailing list Scid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/scid-users