Extract header metadata and export