search and generate txt