I have a lot of files that have the same below format in different folders and I need to parse these files and add them in one file :

X1 = 1
X2 = 2
X3 Y1 Y2
0.005 0.047539 0.029597
0.362143 0.078621 0.0087323

What I need to do is to write the above data in diferent format like that:
X1 X2 X3 Y1 Y2
1...