> Hi,
>
> Are there any scripting or batch processing functions in scid?
Yes.
> For example:
>
> 1. You have a pgn file of thousands of chess positions from games, but
> not the games themselves. Say like a file containing tactical positions
> from famous games. You want to want to search for those positions in
> your normal big database because you want to play through the games
> completely and not just solve the positions as problems.
> But you might not want to do this individually for each position. It
> might take a long time.
> Can that be scripted or batch processed?
Yes.
>
> 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
------------------------------------------------------------------------------
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