Page 1 of 1

Replacing text using other line

Posted: Wed Sep 28, 2005 5:03 pm
by larryse
Hello Roman,

First thanks for yopur previous help, it was great!!

New question.

I have an line of text that needs to be replaced with part of a previous line.

eg
InstanceName = "YC-10-ESD-002" ;
Security = "Control SCADA" ;
Dynamic = True ;
Layer = "0" ;
InsertionPoint = (18.21310955498534, 21.16815315916222)
Rotation = 0.0000000000000000 ;
Size = (11.50000000000000, 2.000000000000000)
RTText = {
LabelText = "Static Text/Value" ;
FontName = "roman" ;
FontSize = -1.000000 ;
LabelActiveColor = 178 ;
BackgroundColor = 2 ;
ShowBackground = True ;
Justification = 0 ;
DataType = 2 ;
TotalDigits = 6 ;
DecimalPoints = 2 ;
InitiallyActive = True ;
RTEnable = True ;
RTPoint = "analog.1.curval" ;

needs to be changed to:
InstanceName = "YC-10-ESD-002" ;
Security = "Control SCADA" ;
Dynamic = True ;
Layer = "0" ;
InsertionPoint = (18.21310955498534, 21.16815315916222)
Rotation = 0.0000000000000000 ;
Size = (11.50000000000000, 2.000000000000000)
RTText = {
LabelText = "Static Text/Value" ;
FontName = "roman" ;
FontSize = -1.000000 ;
LabelActiveColor = 178 ;
BackgroundColor = 2 ;
ShowBackground = True ;
Justification = 0 ;
DataType = 2 ;
TotalDigits = 6 ;
DecimalPoints = 2 ;
InitiallyActive = True ;
RTEnable = True ;
RTPoint = "status.YC-10-ESD-002.flag.msgtxt" ;


I looked at other messages and thought this might do it:
search for:
InstanceName = "(\d{13})(.*)RTText = {(.*)RTPoint = "analog.1.curval" ;

replace with:
InstanceName = "$1$2RTText = {$3RTPoint = "status.$1.flag.msgtxt" ;

but it does not work.
use regular expressions ON ans S modifier was both on and off

can u help please.

thanx

Posted: Wed Sep 28, 2005 5:10 pm
by Abacre
Use the following:

Search for:
InstanceName = "(.*)"(.*)RTText = {(.*)RTPoint = "analog.1.curval" ;

Replace with:
InstanceName = "$1"$2RTText = {$3RTPoint = "status.$1.flag.msgtxt" ;

(Modifier S should be ON).