This question already has an answer here:
- Join lines from two files 1 answer
I made two files, foo.txt and bar.txt
foo.txt looks as such:
foo1 foo2 foo3 foo4 foo5 foo6 foo7 foo8 foo9 foo10
bar1 bar2 bar3 bar4 bar5 bar6 bar7 bar8 bar9 bar10
How do you then get these two text files and output them into a text file called foobar.txt, ordering them as
foo1 bar1 foo2 bar2 foo3 bar3 ...
Admin stuff: I'm getting warnings about this being a duplicate question because people have suggested combining
foo1 foo2 foo3 foo4 foo5
bar1 bar2 bar3 bar4 bar5
Is the same process. If you have to do this instead you can find the question addressing text on new line combination here: Link to user2120893's Question
To address editing files, with one command, of spaced items, you need to use the answer I have marked below using awk. I kept seeing questions of 'how to combine two lists' and 'how to separate spaced lists into new line lists' but never a one line command, using awk, to separate two spaced lists by awk functions then combine them via being designated through awk. A huge thank you to Sergiy Kolodyazhnyy for finally answering my question (and only using one command to do it!). I've been looking for an answer to this for a while and an awk wizard stepped in to show us the ropes. Credit to John1024 for another great answer.