Also,I have to check header,trailer,file and header filename match,count check in trailer section,Total column check and not null check to automate the things.
I recommend coming up with something you've tried to move things along; otherwise, this seems a bit vague. For example, something like this....
find <particular-path> -name '*<some-common-pattern*' | while read a
do
filename_in_header=`head -1 ${a) | awk '{print $NF}'`
filename_in_trailer=`tail -1 {a} | awk '{print $NF}'`
.
. <compare each of the above to the filename ${a} and then do whatever
.
done
This is just a simple example to illustrate what I mean by posting something you've tried.
We encourage all users at unix.com to post the code and scripts they have tried "on their own" and any error messages they got when they tried and failed.