to parse (or grep) a number from a datafile and write it to tab limited file

Hi All,
I have a folder that contain 100's of subfolders namely:

Main folder -> GHFG
  - Subfoders ->10 
                        100
                        234
                        102
                        345
                        ..
                        ..
                        ..
                        100's of folders

Note that each subfolder have a number as name.

Within each subfolder there are 3 files named associated with the subfolder name but different extensions.

For Example:
In the subfolder 100: there are 3 files->100.txt, 100.out and 100.log

What I need is to grep (parse) a data (numberical) value from the .log file and then print this value in a tab delimited file in the main folder in the following way:

            10 3456 (value greped)
                       100 567
                        234 56
                        102 678
                        345 6789

Following is an example of a log file

sizeof(size_t) = 8 bytes


      224 bytes for distance
   221552 bytes for conP
     7264 bytes for fhK
  5000000 bytes for space

2 branch types are in tree. Stop if wrong.
TREE #  1
(((7, 2), ((((3, 4), 5), 6), 8)), 1);   MP score: 416
This is a rooted tree, without clock.  Check.

  3101728 bytes for conP, adjusted

ntime & nrate & np:    14     2    18
branch=0  freq=0.702014 w0 = 0.283251
branch=0  freq=0.297986 w1 = 1.000000
                        Qfactor for branch 0 = 7.296155
branch=1  freq=0.560244 w0 = 0.283251
branch=1  freq=0.237809 w1 = 1.000000
branch=1  freq=0.201947 w2 = 1.000000
                        Qfactor for branch 1 = 6.472120
w[0] = 0.283251
w[1] = 1.000000
w[2] = 1.000000
Out..
lnL  = -4436.816826
1133 lfun, 9064 EigenQcodon, 67400 P(t)
end of tree file.

Time used:  2:05

What I need to grep is highlighted with bold font (lnL = -4436.816826)

I need to have the numerical value, -4436.816826 parsed out and printed to a file along with the first part of folder name.

Please let me know the best way to do this in sed or awk.

LA

something like;

for file in $(find . -name "*.log" -type f 2>/dev/null)
do
filename=$(basename $file)
filepart=${filename%\.*}
value=$(grep '^lnL' $file | awk -F "[ ]*=[ ]*" '{print $2}')
printf "%s\t%s\n" $filepart $value
done

Thanks..it worked