I have a large data set and I need to replace the content of the data set by a number based on a text search. However, I want to keep the same format as it was in the original file.
Here is a small example of the file:
15 1.000(10e12.4) -1 CONSTANT
0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00
0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00
15 1.000(10e12.4) -1 CONSTANT
2.7500e-04 1.5000e-04 1.5000e-04 1.5833e-04
I want to replace the above data set by searching for the word "CONSTANT" and replacing the numbers below the word "CONSTANT" with 2.2283e-03.
Here is how the final data set should look like. One of the most important part is keeping the format intact, i.e., the spacings between the numbers should be as it is with the original data set and also the way the number is written, i.e, 2.2283e-03.
15 1.000(10e12.4) -1 CONSTANT
2.2283e-03 2.2283e-03 2.2283e-03 2.2283e-03
2.2283e-03 2.2283e-03 2.2283e-03 2.2283e-03
15 1.000(10e12.4) -1 CONSTANT
2.2283e-03 2.2283e-03 2.2283e-03 2.2283e-03
Thank you always for any help.
Here is a small example of the file:
15 1.000(10e12.4) -1 CONSTANT
0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00
0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00
15 1.000(10e12.4) -1 CONSTANT
2.7500e-04 1.5000e-04 1.5000e-04 1.5833e-04
I want to replace the above data set by searching for the word "CONSTANT" and replacing the numbers below the word "CONSTANT" with 2.2283e-03.
Here is how the final data set should look like. One of the most important part is keeping the format intact, i.e., the spacings between the numbers should be as it is with the original data set and also the way the number is written, i.e, 2.2283e-03.
15 1.000(10e12.4) -1 CONSTANT
2.2283e-03 2.2283e-03 2.2283e-03 2.2283e-03
2.2283e-03 2.2283e-03 2.2283e-03 2.2283e-03
15 1.000(10e12.4) -1 CONSTANT
2.2283e-03 2.2283e-03 2.2283e-03 2.2283e-03
Thank you always for any help.