linux - Write variables in different columns? -


i convert file 1 column file different columns. in initial file, have 4 variables. each variable write 10 lines, , have 4 columns of 10 lines.

graphically:

what have:

1 1 2 2 3 3 4 4 

what have:

1 2 3 4 1 2 3 4 

you can use paste this, if save variables' lines own respective files.

$ # generating example files: $ seq 1 10 > file1 $ seq 11 20 > file2 $ seq 21 30 > file3 $ seq 31 40 > file4 $ # showing contents of files: $ cat file{1..4} 1 # first file 2 3 4 5 6 7 8 9 10 11 # second file 12 13 14 15 16 17 18 19 20 21 # third file 22 23 24 25 26 27 28 29 30 31 # fourth file 32 33 34 35 36 37 38 39 40 $ paste file{1..4} 1   11  21  31 2   12  22  32 3   13  23  33 4   14  24  34 5   15  25  35 6   16  26  36 7   17  27  37 8   18  28  38 9   19  29  39 10  20  30  40 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -