in reply to count total number of occurrence in all files

Hi umaykulsum,

I am sorry, but I do not really understand what your code is doing or trying to do. Can you please show some input data? And also the expected output for that input?

And please explain the content of the %compare hash which never appears to get populated in the code you are showing.