Can this be done using awk?
find a text string
1st search text string is: Plugback
once found - drop down two lines
then write to a file all the lines that occur between that point and one line above new search string
2nd search string is: -----
(5 dashes)
repeat until end of file.
I used to do this in vi with a macro - files are getting too large and need to be automated.
The results should look like this:
5035214750000 002 BRPG 9366 9400 8488
30045070230000 001 SQZD 6190 6244 5800
30045071110000 001 SQZD 5686 5714
30045071110000 002 SQZD 5750 5808
Here is a sample dataset:
25035214750000 -------------------- Production Tests ----------------------------
25035214750000 Top Base Top Base Oil Prod Test
25035214750000 Test Form Form Depth Depth Choke GORGrav Method Method
25035214750000 001 602CBNK 602CBNK 8775 8785 PERF UNDESIGNATED
25035214750000 002 353SRVR 353SRVR 9366 9400 PERF UNDESIGNATED
25035214750000 Production Shutoff ----------------------------
25035214750000 Shutoff Top BasePlugback
25035214750000 Test Type Depth Depth Depth
25035214750000 002 BRPG 9366 9400 8488
25035214750000 Production Volume ----------------------------
25035214750000 Oil Cond Gas Wtr
25035214750000 Test Amount Unit Desc Amount Unit Desc Amount Unit Desc Amount Unit Desc
25035214750000 001
25035214750000 002
25035214750000 Production Treatment ----------------------------
25035214750000 Test Top Base Volume MeasAmount T/P PSI Inj Type Nbr Agent Add
25035214750000 002 9366 9400 ACID
25035214750000 Production Perforation ----------------------------
25035214750000 Test Top Base Type Method Top Form Base Form Status Count Density Per
25035214750000 001 8775 8785 PERF 602CBNK 602CBNK
25035214750000 002 9366 9400 PERF 353SRVR 353SRVR
25035214750000
25035214750000 -------------------- Formations -----------------------------
30045070230000 Top Base Top Base Oil Prod Test
30045070230000 Test Form Form Depth Depth Choke GORGrav Method Method
30045070230000 001 602DKOT 602DKOT 6190 6244 48/64 PERF FLOWING
30045070230000 Production Shutoff ----------------------------
30045070230000 Shutoff Top BasePlugback
30045070230000 Test Type Depth Depth Depth
30045070230000 001 SQZD 6190 6244 5800
30045070230000 Production Volume ----------------------------
30045070230000 Oil Cond Gas Wtr
30045070230000 Test Amount Unit Desc Amount Unit Desc Amount Unit Desc Amount Unit Desc
30045070230000 001 250 MCFD
30045070230000 -------------------- Formations -----------------------------
30045071110000 Top Base Top Base Oil Prod Test
30045071110000 Test Form Form Depth Depth Choke GORGrav Method Method
30045071110000 001 602DKOT 602DKOT 5686 5714 PERF SWABBING
30045071110000 002 602DKOT 602DKOT 5750 5808 PERF SWABBING
30045071110000 Production Shutoff ----------------------------
30045071110000 Shutoff Top BasePlugback
30045071110000 Test Type Depth Depth Depth
30045071110000 001 SQZD 5686 5714
30045071110000 002 SQZD 5750 5808
30045071110000 Production Volume ----------------------------
30045071110000 Oil Cond Gas Wtr
CAN YOU HELP???
Thanks,
Keusch
find a text string
1st search text string is: Plugback
once found - drop down two lines
then write to a file all the lines that occur between that point and one line above new search string
2nd search string is: -----
(5 dashes)
repeat until end of file.
I used to do this in vi with a macro - files are getting too large and need to be automated.
The results should look like this:
5035214750000 002 BRPG 9366 9400 8488
30045070230000 001 SQZD 6190 6244 5800
30045071110000 001 SQZD 5686 5714
30045071110000 002 SQZD 5750 5808
Here is a sample dataset:
25035214750000 -------------------- Production Tests ----------------------------
25035214750000 Top Base Top Base Oil Prod Test
25035214750000 Test Form Form Depth Depth Choke GORGrav Method Method
25035214750000 001 602CBNK 602CBNK 8775 8785 PERF UNDESIGNATED
25035214750000 002 353SRVR 353SRVR 9366 9400 PERF UNDESIGNATED
25035214750000 Production Shutoff ----------------------------
25035214750000 Shutoff Top BasePlugback
25035214750000 Test Type Depth Depth Depth
25035214750000 002 BRPG 9366 9400 8488
25035214750000 Production Volume ----------------------------
25035214750000 Oil Cond Gas Wtr
25035214750000 Test Amount Unit Desc Amount Unit Desc Amount Unit Desc Amount Unit Desc
25035214750000 001
25035214750000 002
25035214750000 Production Treatment ----------------------------
25035214750000 Test Top Base Volume MeasAmount T/P PSI Inj Type Nbr Agent Add
25035214750000 002 9366 9400 ACID
25035214750000 Production Perforation ----------------------------
25035214750000 Test Top Base Type Method Top Form Base Form Status Count Density Per
25035214750000 001 8775 8785 PERF 602CBNK 602CBNK
25035214750000 002 9366 9400 PERF 353SRVR 353SRVR
25035214750000
25035214750000 -------------------- Formations -----------------------------
30045070230000 Top Base Top Base Oil Prod Test
30045070230000 Test Form Form Depth Depth Choke GORGrav Method Method
30045070230000 001 602DKOT 602DKOT 6190 6244 48/64 PERF FLOWING
30045070230000 Production Shutoff ----------------------------
30045070230000 Shutoff Top BasePlugback
30045070230000 Test Type Depth Depth Depth
30045070230000 001 SQZD 6190 6244 5800
30045070230000 Production Volume ----------------------------
30045070230000 Oil Cond Gas Wtr
30045070230000 Test Amount Unit Desc Amount Unit Desc Amount Unit Desc Amount Unit Desc
30045070230000 001 250 MCFD
30045070230000 -------------------- Formations -----------------------------
30045071110000 Top Base Top Base Oil Prod Test
30045071110000 Test Form Form Depth Depth Choke GORGrav Method Method
30045071110000 001 602DKOT 602DKOT 5686 5714 PERF SWABBING
30045071110000 002 602DKOT 602DKOT 5750 5808 PERF SWABBING
30045071110000 Production Shutoff ----------------------------
30045071110000 Shutoff Top BasePlugback
30045071110000 Test Type Depth Depth Depth
30045071110000 001 SQZD 5686 5714
30045071110000 002 SQZD 5750 5808
30045071110000 Production Volume ----------------------------
30045071110000 Oil Cond Gas Wtr
CAN YOU HELP???
Thanks,
Keusch