My .bib file is using US postal codes as abbreviations for US states (CA and MA for California and Massachusetts). For a paper I'm writing, these need to be changed to abbreviations such as Calif. and Mass. (cf. Wikipedia).
I'd prefer not to change my .bib file, but instead include a command in my preamble that says "When the entry LOCATION in the .bib file has strings such as , CA, , MA, etc., then substitute these with , Calif., , Mass., etc.". (I've added a comma plus space before the strings to be absolutely certain that it doesn't catch any two-letter strings that aren't US states - not that I know right now what that would be, but just in case).
MWE:
\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\begin{filecontents}{\jobname.bib}
@BOOK{lehiste1970,
AUTHOR = "Ilse Lehiste",
TITLE = "Suprasegmentals",
YEAR = "1970",
LOCATION = "Cambridge, MA",
PUBLISHER = "The M.I.T. Press"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{lehiste1970}
\printbibliography
\end{document}

This should read
Lehiste, Ilse (1970). Suprasegmentals. Cambridge, Mass.: The M.I.T. Press.

.texfile that I can simply comment out whenever I don't need it. All my otherbiblatextweaks are in my preamble too - delving into.bstfiles seems a bit too complicated for me. – Sverre Nov 06 '13 at 17:35@STRING{ak.us = "Alaska"}in one versus@STRING{ak.us = "AK"}in the other, and then you just include the desired one as the first bib file in your list. The only extra effort is in composing yourLOCATIONfields in your bib file asLOCATION = "Fairbanks, " # ak.us,– Steven B. Segletes Nov 06 '13 at 17:42.texpreamble that searches for a specific string in a specific entry in the.bibfile and then replaces that string with another string, I'd prefer to go with such an approach (which in the end seems like an easier solution). – Sverre Nov 06 '13 at 17:45CAandMA, and add others as they appear in my bibliography (I don't think there are too many of them). Is there a simpler solution, though (Steven's suggestion doesn't strike me as a simpler one)? – Sverre Nov 06 '13 at 18:16\DeclareSourcemapfeature with one regexp map per state which you need to change. Someone will certainly show you how if you can't work it out from the docs. – PLK Nov 06 '13 at 19:13regex. I have a couple ofDeclareSourcemapcommands in my premable with someregexstuff in them, but they're much too complicated for me to understand. – Sverre Nov 06 '13 at 19:16