From: Steinar H. Gunderson Date: Fri, 12 Dec 2014 18:11:15 +0000 (+0100) Subject: Make PGN partitioning work better with DOS-style line endings. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=93b72aef4261420c520889c352015a6405e22a26;p=remoteglot-book Make PGN partitioning work better with DOS-style line endings. --- diff --git a/partition-pgn.sh b/partition-pgn.sh index 18a2020..b23bc33 100755 --- a/partition-pgn.sh +++ b/partition-pgn.sh @@ -15,7 +15,7 @@ split_point() { echo $SIZE else TENTATIVE_SPLIT_POINT=$(( SIZE * P / NUM )) - OFFS=$( tail -c +${TENTATIVE_SPLIT_POINT} "$FILE" | grep -b '^$' | head -n 1 | cut -d: -f1 ) + OFFS=$( tail -c +${TENTATIVE_SPLIT_POINT} "$FILE" | grep -b '^\[Event ' | head -n 1 | cut -d: -f1 ) if [ -z "$OFFS" ]; then echo $SIZE else