x=$(find . -name \"*.txt\") echo $x
if I run the above piece of code in Bash shell, what I get is a string containing several file names separated
How about if you use grep instead of find?
ls | grep .txt$ > out.txt
Now you can read this file and the filenames are in the form of a list.