I have a computation which generates an output.txt file continuously.
Once the computation is over, I need to read (using a bash script) an particular value and then use it elsewhere in my script.
For instance, my output.txt ends like this:

```
1.980000e+01 1.527115e-01 3.596175e+01 -8.044004e-02 0.000000e+00-0.000000e+00 0.000000e+00 0.000000e+00 8 2185 3351
    2.000000e+01 3.568107e-01 3.489784e+01 -7.459970e-02 0.000000e+00 -0.000000e+00 0.000000e+00 0.000000e+00 21 2183 3351
    extract 
    fg number=1069 
    number of g in each w=75 
    'end reached !'
    2.000040e+01 0.000000e+00 -0.000000e+00 0.000000e+00 0.000000e+00 -0.000000e+00 0.000000e+00 0.000000e+00 0 1907 2987

```

I need to get the value 1069 (the so-called "fg number").

Can someone tell me how I can read and echo this value using bash?

Thank you all :)

PS: alors, if the string "fg number=" already appears above in the .txt file, how can I get the value given by its last appearance?