Selecting from ... to ... across many lines
Posted: Mon Apr 21, 2008 3:49 am
Hi,
I want to select and then copy into a new document a specific section of a log file (highlighted in BOLD font below). This section is always prefaced with the words SLOW or ERROR SLOW and ends with the words End Request after several new lines. The number of new lines is not constant however the Start/End search string is constant.
The component RX I have tried and which partially succeeds is :-
SL.* = selects from occurrences of SL to end of that line
Request$ = selects "End Request" at the end of a line.
My problem is I cant seem to combine these 2 successfully to select the opening and closing strings and all in between. I can select the start or the end but not both and all in between. I cannot program Perl which I have been told could easily do this, so I am hopeing the TextPad user Community may assist?
After selecting just the ERROR SLOW & SLOW reports from my log file I will then be selecting a few smaller pieces of code to finish with a final result as below which shows the slowest data layer from a web mapping application (in example layer = TR_ROAD and web mapping app = bnr_external_v1). The later can easily be done using simple copy/paste, I am really stuck on selecting just the ERROR SLOW & SLOW errors from my original html log files.
SLOW GET_IMAGE: bnr_external_v1
FEATURE LAYER: Minor Roads (id= TR_ROAD )
DATA RETRIEVAL TIME: 25.609000s
Total Request Time: 33.985000s
I have removed some security code below to ensure web apps are not compromised.
3: <a href="javascript:fnToggleObjDisplay('o10.4964');"> SLOW </a> --> 17/04/2008 8:45:46 AM --> GET_IMAGE: bnr_external_v1
<span class="showMe" id="o10.4964">
[17/04/2008 8:45:46 AM][4964 6252 INFO1] Begin Request
[17/04/2008 8:45:46 AM][4964 6252 INFO3] REQUEST: <?xml version="1.1" encoding="UTF-8"?>
<ARCXML version="1.1">
<REQUEST>
<GET_IMAGE>
<PROPERTIES>
<ENVELOPE minx="2500147.57476554" miny="2368031.16924575" maxx="2530983.72734026" maxy="2394313.16625419" />
<FEATURECOORDSYS id="102171" />
<FILTERCOORDSYS id="102171" />
<BACKGROUND color="255,255,255" transcolor="255,255,255" />
<IMAGESIZE width="887" height="756" dpi="72"/>
<LEGEND antialiasing="true" autoextend="true" cansplit="false" cellspacing="3" columns="1" display="false" font="Arial" height="300" layerfontcolor="0,0,0" layerfontsize="10" layerfontstyle="bold" reverseorder="false" splittext="(cont)" swatchheight="12" swatchwidth="18" title=" " titlefontcolor="0,0,0" titlefontsize="12" titlefontstyle="bold" valuefontcolor="0,0,0" valuefontsize="9" valuefontstyle="bold" width="250">
<LAYERS>
<LAYER id="AL:38284"/>
</LAYERS>
</LEGEND>
<LAYERLIST order="true" nodefault="true" dynamicfirst="false" >
</LAYERLIST>
<DRAW map="true" />
</PROPERTIES>
<LAYER type="acetate" name="Standard Markup" id="AL:38284">
<OBJECT units="pixel">
<TEXTMARKERSYMBOL fontcolor="0,0,0" glowing="255,255,255" antialiasing="true" font="Arial" fontsize="10" overlap="false" halignment="right" valignment="top" />
</TEXT>
</OBJECT>
<OBJECT units="pixel">
<TEXT coords="884 3" label="Map center: 2515566, 2381172">
<TEXTMARKERSYMBOL fontcolor="0,0,0" glowing="255,255,255" antialiasing="true" font="Arial" fontsize="10" overlap="false" halignment="left" valignment="top" />
</TEXT>
</OBJECT>
</LAYER>
</GET_IMAGE>
</REQUEST>
</ARCXML>
[17/04/2008 8:45:46 AM][4964 6252 INFO1] GET_IMAGE: bnr_external_v1
[17/04/2008 8:46:20 AM][4964 6252 STAT2] DATA RETRIEVAL TIME: 0.219000s
[17/04/2008 8:46:20 AM][4964 6252 STAT2] LABEL ENGINE TIME: 0.031000s
[17/04/2008 8:46:20 AM][4964 6252 STAT2] TOTAL PROCESSING TIME: 33.719000s
[17/04/2008 8:46:20 AM][4964 6252 STAT2] OUTPUT TIME: 0.250000s
[17/04/2008 8:46:20 AM][4964 6252 INFO3] RESPONSE: <?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
<RESPONSE>
<IMAGE>
<ENVELOPE minx="2500147.57476554" miny="2368031.16924575" maxx="2530983.72734026" maxy="2394313.16625419" />
<OUTPUT file="d:\arcims\output\bnr_external_v1_p0004549646252369.png" url="http://nremap.nre.vic.gov.au/output/bnr ... 252369.png" />
</IMAGE>
</RESPONSE>
</ARCXML>
[17/04/2008 8:46:20 AM][4964 6252 STAT1] Total Request Time: 33.985000s
[17/04/2008 8:46:20 AM][4964 6252 INFO1] End Request
</span>
I want to select and then copy into a new document a specific section of a log file (highlighted in BOLD font below). This section is always prefaced with the words SLOW or ERROR SLOW and ends with the words End Request after several new lines. The number of new lines is not constant however the Start/End search string is constant.
The component RX I have tried and which partially succeeds is :-
SL.* = selects from occurrences of SL to end of that line
Request$ = selects "End Request" at the end of a line.
My problem is I cant seem to combine these 2 successfully to select the opening and closing strings and all in between. I can select the start or the end but not both and all in between. I cannot program Perl which I have been told could easily do this, so I am hopeing the TextPad user Community may assist?
After selecting just the ERROR SLOW & SLOW reports from my log file I will then be selecting a few smaller pieces of code to finish with a final result as below which shows the slowest data layer from a web mapping application (in example layer = TR_ROAD and web mapping app = bnr_external_v1). The later can easily be done using simple copy/paste, I am really stuck on selecting just the ERROR SLOW & SLOW errors from my original html log files.
SLOW GET_IMAGE: bnr_external_v1
FEATURE LAYER: Minor Roads (id= TR_ROAD )
DATA RETRIEVAL TIME: 25.609000s
Total Request Time: 33.985000s
I have removed some security code below to ensure web apps are not compromised.
3: <a href="javascript:fnToggleObjDisplay('o10.4964');"> SLOW </a> --> 17/04/2008 8:45:46 AM --> GET_IMAGE: bnr_external_v1
<span class="showMe" id="o10.4964">
[17/04/2008 8:45:46 AM][4964 6252 INFO1] Begin Request
[17/04/2008 8:45:46 AM][4964 6252 INFO3] REQUEST: <?xml version="1.1" encoding="UTF-8"?>
<ARCXML version="1.1">
<REQUEST>
<GET_IMAGE>
<PROPERTIES>
<ENVELOPE minx="2500147.57476554" miny="2368031.16924575" maxx="2530983.72734026" maxy="2394313.16625419" />
<FEATURECOORDSYS id="102171" />
<FILTERCOORDSYS id="102171" />
<BACKGROUND color="255,255,255" transcolor="255,255,255" />
<IMAGESIZE width="887" height="756" dpi="72"/>
<LEGEND antialiasing="true" autoextend="true" cansplit="false" cellspacing="3" columns="1" display="false" font="Arial" height="300" layerfontcolor="0,0,0" layerfontsize="10" layerfontstyle="bold" reverseorder="false" splittext="(cont)" swatchheight="12" swatchwidth="18" title=" " titlefontcolor="0,0,0" titlefontsize="12" titlefontstyle="bold" valuefontcolor="0,0,0" valuefontsize="9" valuefontstyle="bold" width="250">
<LAYERS>
<LAYER id="AL:38284"/>
</LAYERS>
</LEGEND>
<LAYERLIST order="true" nodefault="true" dynamicfirst="false" >
</LAYERLIST>
<DRAW map="true" />
</PROPERTIES>
<LAYER type="acetate" name="Standard Markup" id="AL:38284">
<OBJECT units="pixel">
<TEXTMARKERSYMBOL fontcolor="0,0,0" glowing="255,255,255" antialiasing="true" font="Arial" fontsize="10" overlap="false" halignment="right" valignment="top" />
</TEXT>
</OBJECT>
<OBJECT units="pixel">
<TEXT coords="884 3" label="Map center: 2515566, 2381172">
<TEXTMARKERSYMBOL fontcolor="0,0,0" glowing="255,255,255" antialiasing="true" font="Arial" fontsize="10" overlap="false" halignment="left" valignment="top" />
</TEXT>
</OBJECT>
</LAYER>
</GET_IMAGE>
</REQUEST>
</ARCXML>
[17/04/2008 8:45:46 AM][4964 6252 INFO1] GET_IMAGE: bnr_external_v1
[17/04/2008 8:46:20 AM][4964 6252 STAT2] DATA RETRIEVAL TIME: 0.219000s
[17/04/2008 8:46:20 AM][4964 6252 STAT2] LABEL ENGINE TIME: 0.031000s
[17/04/2008 8:46:20 AM][4964 6252 STAT2] TOTAL PROCESSING TIME: 33.719000s
[17/04/2008 8:46:20 AM][4964 6252 STAT2] OUTPUT TIME: 0.250000s
[17/04/2008 8:46:20 AM][4964 6252 INFO3] RESPONSE: <?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
<RESPONSE>
<IMAGE>
<ENVELOPE minx="2500147.57476554" miny="2368031.16924575" maxx="2530983.72734026" maxy="2394313.16625419" />
<OUTPUT file="d:\arcims\output\bnr_external_v1_p0004549646252369.png" url="http://nremap.nre.vic.gov.au/output/bnr ... 252369.png" />
</IMAGE>
</RESPONSE>
</ARCXML>
[17/04/2008 8:46:20 AM][4964 6252 STAT1] Total Request Time: 33.985000s
[17/04/2008 8:46:20 AM][4964 6252 INFO1] End Request
</span>