finding text positions in files