Hi, I am new to VBA. Could some one help me out? I want to extract certain data from txt file into a new excel file.
Here is the text file:
-----------------------------------------------------------------
fit results # 1 for wafer: Wafer #01 - Edi - Center
substrate A
substrate temp. 600.71 °C
substrate start 2818.87 s
substrate end 3628.88 s
layer A
layer temp. 600.77 °C
layer start 2802.67 s
layer end 4349.34 s
wavelength 450.05 nm
bandwidth 5.17 nm
energy 1.31 eV
phi 0.00 eV
run_id D045
mach_id Edi 34-0875-2010
operator <unknown>
location <unknown>
date 2013-04-24
time 11:47:09
info <unknown>
fit-results of fit-method: n-k-r fit: independent optical indices n/k, growth rate r - virtual layer
parameter value error
n 3.5030 0.01647
k 0.1814 0.02991
r(nm/s) 0.5314 0.01186
r(µm/h) 1.9131 0.04270
d(nm) 821.9255 18.34456
d(µm) 0.8219 0.01834
fit-delta 0.479
oscillation period 255.177s
date-time-stamp 2013-04-24-14-16-02
-----------------------------------------------------------------
-----------------------------------------------------------------
fit results # 2 for wafer: Wafer #02 - Edi - Center
substrate A
substrate temp. 603.73 °C
substrate start 2818.87 s
substrate end 3628.88 s
layer A
layer temp. 603.86 °C
layer start 2802.67 s
layer end 4349.34 s
wavelength 450.05 nm
bandwidth 5.17 nm
energy 1.31 eV
phi 0.00 eV
run_id D045
mach_id Edi 34-0875-2010
operator <unknown>
location <unknown>
date 2013-04-24
time 11:47:09
info <unknown>
fit-results of fit-method: n-k-r fit: independent optical indices n/k, growth rate r - virtual layer
parameter value error
n 3.5037 0.01678
k 0.1675 0.03065
r(nm/s) 0.5266 0.01199
r(µm/h) 1.8959 0.04317
d(nm) 814.5496 18.54856
d(µm) 0.8145 0.01855
fit-delta 0.510
oscillation period 257.434s
date-time-stamp 2013-04-24-14-16-17
-----------------------------------------------------------------
And I want to extract the red data and output like this:
[TABLE="width: 308"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD] [/TD]
[TD]substrate temp.[/TD]
[TD]rate[/TD]
[/TR]
[TR]
[TD]wafer #01[/TD]
[TD="align: right"]600.71[/TD]
[TD="align: right"]0.5314[/TD]
[/TR]
[TR]
[TD]wafer #02[/TD]
[TD="align: right"]603.73[/TD]
[TD="align: right"]0.5266[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>
<strike></strike>I appreciate your kind help,
Here is the text file:
-----------------------------------------------------------------
fit results # 1 for wafer: Wafer #01 - Edi - Center
substrate A
substrate temp. 600.71 °C
substrate start 2818.87 s
substrate end 3628.88 s
layer A
layer temp. 600.77 °C
layer start 2802.67 s
layer end 4349.34 s
wavelength 450.05 nm
bandwidth 5.17 nm
energy 1.31 eV
phi 0.00 eV
run_id D045
mach_id Edi 34-0875-2010
operator <unknown>
location <unknown>
date 2013-04-24
time 11:47:09
info <unknown>
fit-results of fit-method: n-k-r fit: independent optical indices n/k, growth rate r - virtual layer
parameter value error
n 3.5030 0.01647
k 0.1814 0.02991
r(nm/s) 0.5314 0.01186
r(µm/h) 1.9131 0.04270
d(nm) 821.9255 18.34456
d(µm) 0.8219 0.01834
fit-delta 0.479
oscillation period 255.177s
date-time-stamp 2013-04-24-14-16-02
-----------------------------------------------------------------
-----------------------------------------------------------------
fit results # 2 for wafer: Wafer #02 - Edi - Center
substrate A
substrate temp. 603.73 °C
substrate start 2818.87 s
substrate end 3628.88 s
layer A
layer temp. 603.86 °C
layer start 2802.67 s
layer end 4349.34 s
wavelength 450.05 nm
bandwidth 5.17 nm
energy 1.31 eV
phi 0.00 eV
run_id D045
mach_id Edi 34-0875-2010
operator <unknown>
location <unknown>
date 2013-04-24
time 11:47:09
info <unknown>
fit-results of fit-method: n-k-r fit: independent optical indices n/k, growth rate r - virtual layer
parameter value error
n 3.5037 0.01678
k 0.1675 0.03065
r(nm/s) 0.5266 0.01199
r(µm/h) 1.8959 0.04317
d(nm) 814.5496 18.54856
d(µm) 0.8145 0.01855
fit-delta 0.510
oscillation period 257.434s
date-time-stamp 2013-04-24-14-16-17
-----------------------------------------------------------------
And I want to extract the red data and output like this:
[TABLE="width: 308"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD] [/TD]
[TD]substrate temp.[/TD]
[TD]rate[/TD]
[/TR]
[TR]
[TD]wafer #01[/TD]
[TD="align: right"]600.71[/TD]
[TD="align: right"]0.5314[/TD]
[/TR]
[TR]
[TD]wafer #02[/TD]
[TD="align: right"]603.73[/TD]
[TD="align: right"]0.5266[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>
<strike></strike>I appreciate your kind help,