Row to column and column to row using awk

后端 未结 4 1904
小鲜肉
小鲜肉 2020-12-19 00:14

I have two files containing as below

cat file1.txt
a b c 
1 2 3

cat file2.txt
a
b
c
1
2
3

I want file1 to be arranged as

a         


        
4条回答
  •  Happy的楠姐
    2020-12-19 01:03

    I'd use xargs for this:

    $ xargs -n1 < file1
    a
    b
    c
    1
    2
    3
    
    $ xargs -n3 < file2
    a b c
    1 2 3
    

提交回复
热议问题