Hi, I have a question that I cannot solve.
if I have a file like this (lets say "x-values.dat"):
x1
x2
x3
another file like this (lets say "y-values.dat"):
y1
y2
y3
y4
and another file like this (lets say "p-values.dat"):
p1
p2
p3
...
p12
How can I get this output?
x1 y1 p1
x1 y2 p2
x1 y3 p3
x1 y4 p4
x2 y1 p5
x2 y2 p6
x2 y3 p7
x2 y4 p8
x3 y1 p9
x3 y2 p10
x3 y3 p11
x3 y4 p12
No, the files doesn't have the same number of records (in my example, X has 3 values, Y has 4, and P has 12), and the code you suggested me didn't work, because it merge each line of each file, and that is not what I exactly need.
You can check my first post in order to see the output that I need.
Yes, the script by Franklin works with any number of lines in x (lets say, nx) and y (lets say ny). The number of lines in p (np) has to be np=nx*ny. But this is how I stated the problem..
I thought that the length of x, y, and p were arbitrary and that the it was just sorted right to left The perl script I wrote handles any length file x, y, and p and sorts them right to left.
I'm just a bit curious: I just want to know if my bash solution worked by you. (because it works by me with your sample and is independent of the numbers x and y rows.)