First create a temp table to receive the data from your DBCC command. I used #table_name below.
Then fire something similar to the following to populate it.
EXECUTE sp_msforeachdb N'USE ?;
INSERT INTO #table_name
EXECUTE sp_executeSQL N''DBCC fileheader(?)'';';
Then you can select from #table_name to get the fields you want.