Hi Russ,
Let's explain how to do it with AFR.
For example, source text:
Code: Select all
<MIFFile 7.00> # Generated by FrameMaker 7.0p578
.
. about 18,000 lines of stuff
.
#
# Within the block of text bracketed by "<AFrames" and "> # end of AFrames",
# I would like to remove all lines beginning with "<ShapeRect" and all lines
# beginning with "<BRect". Also, I need to change "<ImportObFixedSize Yes>" to
# "<ImportObFixedSize No>" and to change "<BitMapDpi 0>" to "<BitMapDpi 96>".
#
# Lines marked with an * are affected and ONLY those lines
#
<AFrames
<Frame
<ID 1>
<Unique 998455>
<Pen 15>
<Fill 15>
<PenWidth 1.0 pt>
<Separation 0>
<ObColor `Black'>
<DashedPattern
<DashedStyle Solid>
> # end of DashedPattern
<RunaroundGap 6.0 pt>
<RunaroundType None>
<Angle 360.0>
*
*
<FrameType Inline>
<NSOffset 0.0">
<BLOffset 0.0">
<AnchorAlign Center>
<Cropped No>
<ImportObject
<Unique 998457>
<Separation 0>
<ObColor `Black'>
<ImportObFileDI `<c\>AOI_island_poly.gif'>
<ImportObFile `AOI_island_poly.gif'>
<ImportHint `0001FRAMGIF WIN3 '>
<ImportObUpdater `GIF'>
*
*
* <ImportObFixedSize No>
* <BitMapDpi 96>
<FlipLR No>
> # end of ImportObject
> # end of Frame
> # end of AFrames
.
. about 22,000 more lines of stuff
.
#
# In all other sections of the document, the ShapeRect and BRect lines
# must remain unchanged.
#
<Page
<Unique 996720>
<PageType BodyPage>
<PageNum `25'>
<PageTag `'>
<PageSize 8.5" 11.0">
<PageOrientation Portrait>
<PageAngle 0.0>
<PageBackground `First'>
<TextRect
<ID 47>
<Unique 998291>
<Pen 15>
<Fill 15>
<PenWidth 1.0 pt>
<Separation 0>
<ObColor `Black'>
<DashedPattern
<DashedStyle Solid>
> # end of DashedPattern
<RunaroundGap 0.0 pt>
<RunaroundType None>
<ShapeRect 0.625" 1.125" 7.0" 8.625">
<BRect 0.625" 1.125" 7.0" 8.625">
<TRNumColumns 1>
<TRColumnGap 0.25">
<TRColumnBalance No>
<TRSideheadWidth 1.5">
<TRSideheadGap 0.25">
<TRSideheadPlacement Left>
<TRNext 48>
> # end of TextRect
> # end of Page
.
. etc.
.
# End of MIFFile
and the resulting text should be:
Code: Select all
<MIFFile 7.00> # Generated by FrameMaker 7.0p578
.
. about 18,000 lines of stuff
.
#
# Within the block of text bracketed by "<AFrames" and "> # end of AFrames",
# I would like to remove all lines beginning with "<ShapeRect" and all lines
# beginning with "<BRect". Also, I need to change "<ImportObFixedSize Yes>" to
# "<ImportObFixedSize No>" and to change "<BitMapDpi 0>" to "<BitMapDpi 96>".
#
<AFrames
<Frame
<ID 1>
<Unique 998455>
<Pen 15>
<Fill 15>
<PenWidth 1.0 pt>
<Separation 0>
<ObColor `Black'>
<DashedPattern
<DashedStyle Solid>
> # end of DashedPattern
<RunaroundGap 6.0 pt>
<RunaroundType None>
<Angle 360.0>
<FrameType Inline>
<NSOffset 0.0">
<BLOffset 0.0">
<AnchorAlign Center>
<Cropped No>
<ImportObject
<Unique 998457>
<Separation 0>
<ObColor `Black'>
<ImportObFileDI `<c\>AOI_island_poly.gif'>
<ImportObFile `AOI_island_poly.gif'>
<ImportHint `0001FRAMGIF WIN3 '>
<ImportObUpdater `GIF'>
<ImportObFixedSize No>
<BitMapDpi 96>
<FlipLR No>
> # end of ImportObject
> # end of Frame
> # end of AFrames
.
. about 22,000 more lines of stuff
.
#
# In all other sections of the document, the ShapeRect and BRect lines
# must remain unchanged.
#
<Page
<Unique 996720>
<PageType BodyPage>
<PageNum `25'>
<PageTag `'>
<PageSize 8.5" 11.0">
<PageOrientation Portrait>
<PageAngle 0.0>
<PageBackground `First'>
<TextRect
<ID 47>
<Unique 998291>
<Pen 15>
<Fill 15>
<PenWidth 1.0 pt>
<Separation 0>
<ObColor `Black'>
<DashedPattern
<DashedStyle Solid>
> # end of DashedPattern
<RunaroundGap 0.0 pt>
<RunaroundType None>
<ShapeRect 0.625" 1.125" 7.0" 8.625">
<BRect 0.625" 1.125" 7.0" 8.625">
<TRNumColumns 1>
<TRColumnGap 0.25">
<TRColumnBalance No>
<TRSideheadWidth 1.5">
<TRSideheadGap 0.25">
<TRSideheadPlacement Left>
<TRNext 48>
> # end of TextRect
> # end of Page
.
. etc.
.
# End of MIFFile
What should you do:
Please download the latest version of the program:
http://www.abacre.com/download/afrexe.zip
This is only updated EXE file. You need to extract executable file from
zip archive into folder where the program is installed. So you will
replace old executable file by this new one.
Start the program. Go to main menu - Action - Options - "Batch
replace" check on the options:
Replace until found is ON
Modifier S is ON.
Press OK.
In main window go to Batch replace tab.
Check on "Use regular expressions".
Then fill the grid:
Search for:
(<AFrames.*)\r\n<ShapeRect.+>(.*> # end of AFrames)
Replace with:
$1$2
Search for:
(<AFrames.*)\r\n<BRect.+>(.*> # end of AFrames)
Replace with:
$1$2
Search for:
(<AFrames.*)\r\n<ImportObFixedSize Yes>(.*> # end of AFrames)
Replace with:
$1\r\n<ImportObFixedSize No>$2
Search for:
(<AFrames.*)\r\n<BitMapDpi 0>(.*> # end of AFrames)
Replace with:
$1\r\n<BitMapDpi 96>$2
That's all. You may press now Execute button.
I verified it perfectly works. The program produced the resulting text
as above.