It depends a bit on the program in question and if it correctly handles piped input, but try this:
yes 1 | trjconv -f (file one) -s (file 2) -o (output)
This really isn't an optimal job for awk or sed, if the simple answer above doesn't work i would suggest trying expect
, it is built for exactly that kind of automation. You could also look at autoexpect, but this would be a pretty trivial expect script.