Is it possible to do something like this:
$ cat foo.txt 1 2 3 4 foo bar baz hello world $ awk \'{ for(i in $){ print $[i]; } }\' foo.txt 1 2 3 4 foo bar baz
No need for awk, sed or perl. You can easily do this directly in the shell:
awk
sed
perl
for i in $(cat foo.txt); do echo "$i"; done