If you have grep installed you can use this, grep -m 1 -e '^.*$' *.ext > output file that will look something like this.
[ned(~/src/python/work)] grep -m 1 -e '^.*$' *.py
ab.py:import string, os, sys, re
add_book.py:import string, os, sys, re
get_file_by_ext.py:import os
gfs.py:import os, re
gfx.py:import os, re
mkfilelst.py:# Creates a list of file names from a given path.
pwd2html.py:import os, sys, time
te.py:import sys, os
xren.py:## A simple program that renames files by changing their case.
You might be able to use find to do this too.