I need 2 lines of text changed if another line exists.
If this line is found
RTText = {
I need to replace these 2 lines
FontSize = 16.0000 ;
FontHeightPct = 55.00000 ;
the trick is the lines are not all in a row but the are always the same number of rows apart. also both of the replacing lines may not need changing.
Can this be done??
Thanks
Larry
replaceing multiple lines
The bold lines are the ones in quesrtion
RTText = {
LabelText = "Anterior:" ;
FontName = "system default" ;
FontSize = 16.00000 ;
LabelActiveColor = 7 ;
BackgroundColor = 252 ;
ShowBackground = True ;
Justification = 0 ;
DataType = 0 ;
TotalDigits = 50 ;
DecimalPoints = 2 ;
InitiallyActive = True ;
RTEnable = False ;
RTPoint = "" ;
RTServer = "CMX" ;
DataQualityEnable = 3 ;
RTUnits = "" ;
ControlPanel = "" ;
FontHeightPct = 75.00000 ;
FloatNotation = 0 ;
WinFontSpecsSupported = 1 ;
TextAttachType = 0 ;
ShowUnits = False ;
Changes to
RTText = {
LabelText = "Anterior:" ;
FontName = "system default" ;
FontSize = -1.000000 ;
LabelActiveColor = 7 ;
BackgroundColor = 252 ;
ShowBackground = True ;
Justification = 0 ;
DataType = 0 ;
TotalDigits = 50 ;
DecimalPoints = 2 ;
InitiallyActive = True ;
RTEnable = False ;
RTPoint = "" ;
RTServer = "CMX" ;
DataQualityEnable = 3 ;
RTUnits = "" ;
ControlPanel = "" ;
FontHeightPct = 35.00000 ;
FloatNotation = 0 ;
WinFontSpecsSupported = 1 ;
TextAttachType = 0 ;
ShowUnits = False ;
thanks
RTText = {
LabelText = "Anterior:" ;
FontName = "system default" ;
FontSize = 16.00000 ;
LabelActiveColor = 7 ;
BackgroundColor = 252 ;
ShowBackground = True ;
Justification = 0 ;
DataType = 0 ;
TotalDigits = 50 ;
DecimalPoints = 2 ;
InitiallyActive = True ;
RTEnable = False ;
RTPoint = "" ;
RTServer = "CMX" ;
DataQualityEnable = 3 ;
RTUnits = "" ;
ControlPanel = "" ;
FontHeightPct = 75.00000 ;
FloatNotation = 0 ;
WinFontSpecsSupported = 1 ;
TextAttachType = 0 ;
ShowUnits = False ;
Changes to
RTText = {
LabelText = "Anterior:" ;
FontName = "system default" ;
FontSize = -1.000000 ;
LabelActiveColor = 7 ;
BackgroundColor = 252 ;
ShowBackground = True ;
Justification = 0 ;
DataType = 0 ;
TotalDigits = 50 ;
DecimalPoints = 2 ;
InitiallyActive = True ;
RTEnable = False ;
RTPoint = "" ;
RTServer = "CMX" ;
DataQualityEnable = 3 ;
RTUnits = "" ;
ControlPanel = "" ;
FontHeightPct = 35.00000 ;
FloatNotation = 0 ;
WinFontSpecsSupported = 1 ;
TextAttachType = 0 ;
ShowUnits = False ;
thanks
Thank you for sample texts. It's clear now.
In main menu - Action - Options - Batch replace
check ON: "Modifier S".
Go to Batch replace tab. Check ON: "Use regular expressions".
Search for:
RTText = {(.*)FontSize = 16\.00000 ;(.*)FontHeightPct = 75\.00000 ;
Replace with:
RTText = {$1FontSize = -1.000000 ;$2FontHeightPct = 35.00000 ;
So: .* means any char.
we pick up text between RTText = { and FontSize = using ()
then in replace part we recover it using $1
we use 16\.00000 because . is a reserved char. So we should escape it
using \.
I verified it worked fine.
In main menu - Action - Options - Batch replace
check ON: "Modifier S".
Go to Batch replace tab. Check ON: "Use regular expressions".
Search for:
RTText = {(.*)FontSize = 16\.00000 ;(.*)FontHeightPct = 75\.00000 ;
Replace with:
RTText = {$1FontSize = -1.000000 ;$2FontHeightPct = 35.00000 ;
So: .* means any char.
we pick up text between RTText = { and FontSize = using ()
then in replace part we recover it using $1
we use 16\.00000 because . is a reserved char. So we should escape it
using \.
I verified it worked fine.
Last edited by Abacre on Wed Sep 21, 2005 6:00 pm, edited 1 time in total.
i screwed somethings, had boxes checked that weren't need, your original reply work like a charm.
One more question,
How would it do the same as above but say exclude items that meet certain requirements.
eg.
RTText = {
LabelText = "Anterior:" ;
FontName = "system default" ;
FontSize = 16.00000 ;
LabelActiveColor = 7 ;
BackgroundColor = 252 ;
ShowBackground = True ;
Justification = 0 ;
DataType = 0 ;
TotalDigits = 50 ;
DecimalPoints = 2 ;
InitiallyActive = True ;
RTEnable = False ;
RTPoint = "" ;
RTServer = "CMX" ;
DataQualityEnable = 3 ;
RTUnits = "" ;
ControlPanel = "" ;
FontHeightPct = 75.00000 ;
FloatNotation = 0 ;
WinFontSpecsSupported = 1 ;
TextAttachType = 0 ;
ShowUnits = False ;
Changes to
RTText = {
LabelText = "Anterior:" ;
FontName = "system default" ;
FontSize = -1.000000 ;
LabelActiveColor = 7 ;
BackgroundColor = 252 ;
ShowBackground = True ;
Justification = 0 ;
DataType = 0 ;
TotalDigits = 50 ;
DecimalPoints = 2 ;
InitiallyActive = True ;
RTEnable = False ;
RTPoint = "" ;
RTServer = "CMX" ;
DataQualityEnable = 3 ;
RTUnits = "" ;
ControlPanel = "" ;
FontHeightPct = 35.00000 ;
FloatNotation = 0 ;
WinFontSpecsSupported = 1 ;
TextAttachType = 0 ;
ShowUnits = False ;
But only if LabelText does NOT equal "Anterior:"
thanks
One more question,
How would it do the same as above but say exclude items that meet certain requirements.
eg.
RTText = {
LabelText = "Anterior:" ;
FontName = "system default" ;
FontSize = 16.00000 ;
LabelActiveColor = 7 ;
BackgroundColor = 252 ;
ShowBackground = True ;
Justification = 0 ;
DataType = 0 ;
TotalDigits = 50 ;
DecimalPoints = 2 ;
InitiallyActive = True ;
RTEnable = False ;
RTPoint = "" ;
RTServer = "CMX" ;
DataQualityEnable = 3 ;
RTUnits = "" ;
ControlPanel = "" ;
FontHeightPct = 75.00000 ;
FloatNotation = 0 ;
WinFontSpecsSupported = 1 ;
TextAttachType = 0 ;
ShowUnits = False ;
Changes to
RTText = {
LabelText = "Anterior:" ;
FontName = "system default" ;
FontSize = -1.000000 ;
LabelActiveColor = 7 ;
BackgroundColor = 252 ;
ShowBackground = True ;
Justification = 0 ;
DataType = 0 ;
TotalDigits = 50 ;
DecimalPoints = 2 ;
InitiallyActive = True ;
RTEnable = False ;
RTPoint = "" ;
RTServer = "CMX" ;
DataQualityEnable = 3 ;
RTUnits = "" ;
ControlPanel = "" ;
FontHeightPct = 35.00000 ;
FloatNotation = 0 ;
WinFontSpecsSupported = 1 ;
TextAttachType = 0 ;
ShowUnits = False ;
But only if LabelText does NOT equal "Anterior:"
thanks