Skip to content
Bruce D'Arcus edited this page Jul 9, 2022 · 8 revisions

If you have one very large bibliography file that changes a lot, consider splitting it in two, perhaps with a script like this.

#!/bin/bash

# large, changes less frequently
BIG=library.bib
# small, changes more frequently
SMALL=new.bib

# size of small before script actually does anything
MAXSIZE=5000

# Get file size
FILESIZE=$(stat -c%s "$SMALL")

if ((FILESIZE > MAXSIZE)); then
    # when $SMALL exceeds $MAXSIZE, move its content to $BIG
    cat "$SMALL" >> "$BIG"
    echo "" > "$SMALL"
fi

This will ensure the large file is ideally only parsed once per session, and the small file as needed, which is must faster.

Clone this wiki locally