put search result in a file