awk loop through input

I have a list of objects and I want to rewrite them with a prefix and suffix. I couldn't find a good example so I had to work it out myself.


awk '{ for (i = 1; i <= NF; i++) { printf "prefix-" $i "-suffix " } print}'

For example:

$ echo 20220320-094333 20220320-094335 20220320-094337 20220320-094348 20220320-094352 20220320-094354 20220320-094356 20220320-094358 20220320-094400 20220320-094402 20220320-094411 20220320-094414 20220320-094415 20220320-094417 20220320-094419 | \
awk '{ for (i = 1; i <= NF; i++) { printf "Report-"$i".txt, " } print}'
Report-20220320-094333.txt, Report-20220320-094335.txt, Report-20220320-094337.txt, Report-20220320-094348.txt, Report-20220320-094352.txt, Report-20220320-094354.txt, Report-20220320-094356.txt, Report-20220320-094358.txt, Report-20220320-094400.txt, Report-20220320-094402.txt, Report-20220320-094411.txt, Report-20220320-094414.txt, Report-20220320-094415.txt, Report-20220320-094417.txt, Report-20220320-094419.txt, 20220320-094333 20220320-094335 20220320-094337 20220320-094348 20220320-094352 20220320-094354 20220320-094356 20220320-094358 20220320-094400 20220320-094402 20220320-094411 20220320-094414 20220320-094415 20220320-094417 20220320-094419

(I'm running this in a very limited container, so plain old awk was the best solution for me).