Thanks for your replies, but I couldn't get it to work with my file..
I attach here the file I need to work with (data.txt), and I'll try to explain what I exactly want.
I have a file which has this structure:
Quote:
header
more header
more header..
x1 x2 x3 x4 x5 x6
x7 x8 ...
...
... x59 x60
y1 y2 y3 y4 y5 y6
y7 y8 ...
...
... y99 y100
y1 y2 y3 y4 y5 y6
y7 y8 ...
...
... y99 y100
p1 p2 p3 p4 p5 p6
p7 p8 ...
...
... p59 p60
d1 d2 d3 d4 d5 d6
d7 d8 ...
...
...d59 d60
e1 e2 e3 e4 e5 e6
e7 e8 ...
...
... e59 e60
f1 f2 f3 f4 f5 f6
f7 f8 ...
...
... f59 f60
p61 p62 p63 p64 p65 p66
p67 p68 ...
...
...p119 p120
d61 d62 d63 d64 d65 d66
d67 d68 ...
...
...d119 d120
e61 e62 e63 e64 e65 e66
e67 e68 ...
...
... e119 e120
f61 f62 f63 f64 f65 f66
f67 f68 ...
...
... f119 f120
p121 p122 p123 ...
...
...
...
...f5999 f6000
What I need is this output file:
Quote:
x1 y1 p1 e1 d1 f1
x1 y2 p2 e2 d2 f2
x1 y3 p3 e3 d3 f3
...
x1 y100 p100 e100 d100 f100
x2 y1 p101 e101 d101 f101
x2 y2 p102 e102 d102 f102
x2 y3 p103 e103 d103 f103
...
x2 y100 p200 e200 d200 f200
x3 y1 p201 e201 d201 f201
x3 y2 p202 e202 d202 f202
...
...
x60 y1 p5901 e5901 d5901 f5901
...
x60 y100 p6000 e6000 d6000 f6000
In the attached file, the header spans 14 columns. From lines 15 to 24 (inclusive) there are the X values. From 25 to 41 (and also 42 to 58) there are the Y values.
From line 61 to 70, there are the first 60 P values, from 71 to 80 the first E values, ...
From line 101 to 110, there are the values of P61, P62, ....
In total, there are 60 different values for X, 100 different values for Y, and 6000 different values for P,E,D, and F.
I hope I have explained my problem clearly.
Please help me!