I want to add the second column of file2 to file1, that contains a number an unknown number of columns, so becoming the last column of file1.In this aim, I tried to create a file3 composed by pasting a file1 and only the second column of file2:file1:col11  col12  col13  ...  col1nfile2:col21  col22  col23  ...  col2mnew file1 or file3:col11 col12  ...  col1n  col22I'm using the command:awk '{ print $0 > file3; getline<file2; print $2 > file3 }' file1 &but the arguments of the col22 instead of forming the last column of the new file will go on a new line.Someone can help me to find and correct the error or also in finding a more effective solution?My operating system is fedora12.
How to add a column from a file to the last column of another file using awk?
text processing;awk