So the correct thing I believe to do here is to source the text file. A test which you can perform, as I always also do, is to follow the regimen that "everything you can do within the bash shell prompt, you can do within a script".
$ echo $ABC
$ echo "ABC=123" > 1.txt
$ cat 1.txt
$ source 1.txt
Explanation: I "sourced" 1.txt which contained a simple variable assignment. I validated in advance that the variable was not present in my bash shell environment. After sourcing that text file, the variable was now present in my shell environment.
Therefore I suggest you source your text file.
Be aware that other things besides variable assignments may not work. You'll have to test them out. But since this is exactly what you are doing, variable assignments, I believe it may work for you. Give it a try.