It depends on what you want to do and how your program handle input args.
But let's say you have /path/to/myprogram.sh
who look like this one :
#!/bin/bash
echo "Processing file ${1?missing input file}"
You could do the following
find /path/to/inputfiles -name "*.txt" -exec /path/to/myprogram.sh {} \; > Out.txt
Or within bash (or any Bourne-like shell):
for i in *.txt; do /path/to/myprogram.sh "$i"; done > Out.txt
(I use for-loop or find because it will be much more convenient if you have 1000 input files instead of the 4 files in your example)
cat /dev/null > Out.txt
and have>>
on all invocations of./myprogram
.