I have a text file with values, and I'm trying to create and fill a column from a specific row in the file. To be more precise, the input is the following:
<name>RELATIVE 1</name>
0.624790,-0.000000,0
0.493925,0.591035,0
0.363039,1.182079,0
<name>RELATIVE 2</name>
-24.621334,0.000000,0
-24.752199,0.591031,0
-24.883085,1.182072,0
<name>RELATIVE 3</name>
-49.868542,0.000000,0
-49.999397,0.591014,0
-50.130271,1.182033,0
and the expected output should be:
0.624790,-0.000000,0 <name>RELATIVE 1</name>
0.493925,0.591035,0 <name>RELATIVE 1</name>
0.363039,1.182079,0 <name>RELATIVE 1</name>
-24.621334,0.000000,0 <name>RELATIVE 2</name>
-24.752199,0.591031,0 <name>RELATIVE 2</name>
-24.883085,1.182072,0 <name>RELATIVE 2</name>
-49.868542,0.000000,0 <name>RELATIVE 3</name>
-49.999397,0.591014,0 <name>RELATIVE 3</name>
-50.130271,1.182033,0 <name>RELATIVE 3</name>
the solution could be in Bash, Awk or Sed.
Thanks in advance for the help.