increase file position counter at the end of the main loop