From: Steinar H. Gunderson Date: Sat, 13 Dec 2014 00:09:06 +0000 (+0100) Subject: Use the new pgn-extract partitioning to get the file offsets right. X-Git-Url: https://git.sesse.net/?p=remoteglot-book;a=commitdiff_plain;h=73ec86a2c9ef47c1fa25f23bdc58ace345635ef1 Use the new pgn-extract partitioning to get the file offsets right. --- diff --git a/find-pgn-split-point.sh b/find-pgn-split-point.sh index b23bc33..111beae 100755 --- a/find-pgn-split-point.sh +++ b/find-pgn-split-point.sh @@ -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 diff --git a/parallel-parse-pgn.sh b/parallel-parse-pgn.sh index 37ce2e4..cfb61bc 100755 --- a/parallel-parse-pgn.sh +++ b/parallel-parse-pgn.sh @@ -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