how to grab some information from log file to make a new file

Dear everyone,
I need to delete atoms which are outside my selected region every time step, so part of my input file is like this:
       
label loopa
       variable a loop 10000
       region routside cylinder z 0 0 $(v_r+5) INF INF side out
       group outside region routside
       delete_atoms group outside
       run 1
      region routside delete
       next a
       jump ../input_files/in.1000.0.0 loopa

Starting with this input file, the following part will repeat as many times as the run steps in my input file.
        
region routside delete
group outside delete
next a
jump ../input_files/in.1000.0.0 loopa
variable a loop 30000
region routside cylinder z 0 0 $(v_r+5) INF INF side out
region routside cylinder z 0 0 20 INF INF side out
group outside region routside
0 atoms in group outside
delete_atoms group outside compress no
Deleted 0 atoms, new total = 180545
run 1
Memory usage per processor = 18.4694 Mbytes
Step Temp PotEng KinEng TotEng Press Volume Dt dismax mytime
2 401.26398 -634417.1 9364.3552 -625052.74 28917.037 3914003 1e-05 0.0027530658 2e-05
3 478.45849 -636228.26 11165.855 -625062.4 28824.125 3914003 1e-05 0.0037647147 3e-05
Loop time of 0.0469388 on 16 procs for 1 steps with 180545 atoms

Pair time (\) = 0\.040796 \(86\.9132\) Neigh time \() = 0 (0)
Comm time (\) = 0\.00247021 \(5\.26262\) Outpt time \() = 0.00182778 (3.89396)
Other time (%) = 0.00184481 (3.93024)

Nlocal: 11284.1 ave 11359 max 11172 min
Histogram: 2 0 2 2 1 1 0 0 4 4
Nghost: 6749.75 ave 6865 max 6675 min
Histogram: 5 3 0 0 1 1 3 1 1 1
Neighs: 524984 ave 535511 max 517380 min
Histogram: 4 1 1 1 2 3 2 0 1 1
FullNghs: 1.04997e+06 ave 1.05797e+06 max 1.03783e+06 min
Histogram: 2 0 1 3 0 1 1 1 3 4

Total # of neighbors = 16799510
Ave neighs/atom = 93.0489
Neighbor list builds = 0
Dangerous builds = 0

It is very inconvenient for me to plot a picture of step vs. potential energy or the other values of the thermo output. I just want the following part. And I am wondering how I can get this out from the log file and make a new file which just contains the thermo output information.
Step Temp PotEng KinEng TotEng Press Volume Dt dismax mytime
2 401.26398 -634417.1 9364.3552 -625052.74 28917.037 3914003 1e-05 0.0027530658 2e-05
3 478.45849 -636228.26 11165.855 -625062.4 28824.125 3914003 1e-05 0.0037647147 3e-05

Any help would be much appreciated!

With My Best Regards
Liu