# Last edited on 2022-11-14 15:24:41 by stolfi SPLITTING THE BIBLIOGRAPHY bdir="split-bib" mkdir -pv ${bdir} rm -rf ${bdir}/* for f in stolfi.bib students.bib others.bib ; do split_bib.gawk -v bdir="${bdir}" $f done CKECKING IF KEYS ARE PROPERLY SPLIT cat stolfi.bib students.bib others.bib \ | egrep -e '^[@]' \ | sort > .joint.keys cat split-bib/*/*.bib \ | egrep -e '^[@]' \ | sort > .split.keys wc -l .joint.keys .split.keys prdiff -BB .joint.keys .split.keys for f in joint split ; do \ echo "=== ${f} ===" cat .${f}.keys | uniq -d done 1321 .joint.keys 1321 .split.keys (no duplicate keys) RE-MERGING THE BIBLIOGRAPHY ?? CKECKING "STOLFI" AND "STUDENTS" BIBLIOGRAPHIES for ff in stolfi students ; do if [[ $ff = "stolfi" ]]; then pat='ANON|(author|editor).*J([.]|orge)[{} ]*Stolfi' else pat='dvisor.*J([.]|orge)[{} ]*Stolfi' fi egrep -l -e "${pat}" ${bdir}/*/*.bib \ | sed -e 's:.*/::g' -e 's:[.]bib::g' \ | sort > .${ff}.bibs egrep -e '^[@]' ${ff}.bib \ | sed -e 's:^@.*{::g' -e 's:[, ]*$::g' \ | sort > .${ff}-org.bibs wc -l .${ff}{-org,}.bibs prdiff -BB .${ff}{-org,}.bibs done 234 .stolfi-org.bibs 234 .stolfi.bibs 26 .students-org.bibs 26 .students.bibs (no differences) >>> TO DO >>> SORTING THE BBLIOGRAPHY WITH BIB TOOLS for bibname in others ; do bibtool \ -v \ -i ${bibname}.bib \ -r bib-sort-by-title.rsc \ -m .${bibname}-macros-def \ -M .${bibname}-macros-used \ -o .${bibname}-sort.bib done bibtex_sort.py others.bib > .others-sort.bib