Given several .bib files ref1.bib,ref2.bib,ref3.bib,... and a latex document which uses a subset of the references from all the .bib files via \bibliography{ref1,ref2,ref3,...}, I would like to generate a new .bib file combined_ref.bib which contains the original bibtex entries of all references that are cited in the latex document.
I am aware of the .bbl file, but it outputs a formatted list of references. I want basically a similar file but with the original bibtex entries.
Is there a way to do that?