I want to get the value 0.98728E-02 from file 1 that is on line 2 and put in place the value of 1,000 of file 2 that is in line 8. How to do file 1 substitution for file 2?
My file 1:
Genetic variance(s) for effect 2 0.98728E-02 Genetic variance(s) for effect 3 0.56818E-02
I need to get the values "0.98728E-02" and put in line in place of the "1.0000" of file 2
My file 2:
DATAFILE renf90.dat NUMBER_OF_TRAITS 1 NUMBER_OF_EFFECTS 9 RANDOM_RESIDUAL VALUES 1.0000 RANDOM_GROUP 2
I started doing it in "sed" language, but I do not know what else to do ...
sed '23s/1.0000/ .....
Final file that I want to have.
DATAFILE renf90.dat NUMBER_OF_TRAITS 1 NUMBER_OF_EFFECTS 9 RANDOM_RESIDUAL VALUES 0.98728E-02 RANDOM_GROUP 2
PS: You do not have any constant keywords before or after the lines. PS: Depending on the output file (File 1), I will need to extract two or three values.