Interative saving the no. of hits in a file