I have 2 files having different number of columns and with huge number of rows:
bash-3.00$ cat fileA
a1,a2,a3,a4,a5,a6,a7,a8,a9
q,w,,,,y,u,,
a,z,,,,q,n,,
.........................
z,p,,,,w,e,,
PS1: a1 - a9 are the headers separated by comma (,). PS2: dot signs (.) means that there are many lines between the two lines
bash-3.00$ cat fileB
b1 b2
f t
a p
m n
..........
m y
t o
PS: b1 - b2 are the headers and separated by space.
I want to append the a2 and a6 columns of fileA to the contents of b1 and b2 columns. That is, a2 column will be appended to the b1 column; a6 column will be appended to the b2 column.
So, the output file would be as follows:
bash-3.00$ cat output
a1,a2,a3,a4,a5,a6,a7,a8,a9
q,w,,,,y,u,,
a,z,,,,q,n,,
.........................
z,p,,,,w,e,,
,f,,,,t,,,
,a,,,,p,,,
,m,,,,n,,,
.........................
,m,,,,y,,,
,t,,,,o,,,
How can I do that by a simple awk command?
formatted text, not as pictures?