]> git.sesse.net Git - remoteglot-book/commitdiff
Use the new pgn-extract partitioning to get the file offsets right.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 13 Dec 2014 00:09:06 +0000 (01:09 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 13 Dec 2014 00:09:06 +0000 (01:09 +0100)
find-pgn-split-point.sh
parallel-parse-pgn.sh

index b23bc339872c249ddb8f158c620c5cd072936a7c..111beaecc30a0341fd53750f8fa76050235317b0 100755 (executable)
@@ -24,8 +24,4 @@ split_point() {
        fi
 }
 
-FROM=$( split_point "$FILE" $P $NUM )
-TO=$( split_point "$FILE" $(( P + 1 )) $NUM )
-SIZE=$(( TO - FROM ))
-
-tail -c +$FROM "$FILE" | head -c $SIZE
+split_point "$FILE" $P $NUM
index 37ce2e4f99e7150e531941c55fddc34ef80277f3..cfb61bcc6305fffee6efe016a9e61c92013f97d7 100755 (executable)
@@ -1,6 +1,10 @@
 #! /bin/sh
 FILE=$1
 for X in $( seq 0 39 ); do
-       ( ./partition-pgn.sh "$FILE" $X 40 | ~/nmu/pgn-extract/pgn-extract -e -Wsessebin >> part-$X.bin 2>/dev/null ) &
+       (
+               START=$( ./find-pgn-split-point.sh "$FILE" $X 40 )
+               END=$( ./find-pgn-split-point.sh "$FILE" $(( X + 1 )) 40 )
+               ~/nmu/pgn-extract/pgn-extract --startpos $START --endpos $END -e -Wsessebin "$FILE" >> part-$X.bin 2>/dev/null
+       ) &
 done
 wait