Replacing text using other line

General discussions about Advanced Find and Replace
Post Reply
larryse
Posts: 7
Joined: Mon Sep 19, 2005 4:08 pm

Replacing text using other line

Post 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

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Post 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).
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Post Reply