This question asks how to keep a code in a bbl file. Fortunately, the root cause could be found and solved without fiddling with the bbl file. Several answers pointed out that the bbl file should not be changed and that there are (usually) better ways to accomplish whatever is the goal.
However, there are situations in which modifying the bbl file is the only option. In this case, I need to balance the columns on the last page of an article using the ACM sig-alternate LaTeX class. The "official" solution, suggested by the authors of the sig-alternate style, is to modify the bbl file and insert the command
\balancecolumns in the position where the column break should occur. Naturally, I would like to avoid modifying it directly and instead find a maintainable way of getting the column break.
None of the solutions I have found work in my case (I know that they work in some cases, but I now have a paper where they don't). I have tried the
balance package, the
flushend package, experimented with the
multicol package, fiddled with the page height, ...
At this point, the most maintainable solution really does seem to be to somehow get the ACM sig-alternate class command
\balancecolumns into the bbl file automatically. Is there any way I can accomplish this by editing the BibTeX file or the LaTeX file? It's fine if I have to specify myself where the break should occur, but I would not like to modify temporary files such as the bbl file. Do I have to resort to programmatically editing the file with sed or something?