I have an input like following.
*DEFINE_CURVE_TITLE
Force for tool binder
$# lcid sidr sfa sfo offa offo dattyp
3 0 1 .000000 125.00000 0.000 0.000 0
$# a1 o1
0.000 0.000
0.5000000 -1.0000000
100.0000000 -1.0000000
I want to modify the 3rd line after *DEFINE_CURVE_TITLE like
3 0 1.000000 107.00000 0.000 0.000 0
so that it becomes
*DEFINE_CURVE_TITLE
Force for tool binder
$# lcid sidr sfa sfo offa offo dattyp
3 0 1 .000000 107.00000 0.000 0.000 0
$# a1 o1
0.000 0.000
0.5000000 -1.0000000
100.0000000 -1.0000000
The question is that I can search for the required line as follows
sed -i -e '/^\**DEFINE_CURVE_TITLE/{n;n;n;R $4 newBHF.txt' -e 'd}' input.txt
This way I am on the line to be edit i.e. three lines below the search string.
Now I have to change the values of $4 from 125.00000 to someother value that could be taken from newBHF.txt. That newBHF.txt has the required replacement i.e only one value 107.00000 . If possible please also tell me how can I set $4 , if I have the value in another variable in the same program.
This will help to do alot of things myself. :wall:
best regards